Remove an object from an array of string



how to remove a string from an array of string[]


If you want to delete the element based on value then use


If you want delete based on index then use



there is no remove methode for arrays


You can convert it to list using array.toList, then it will have the given methods but effectively that should affect your array

Also this can be achieved using linq so you can using inside an assign (other method are subs and require to use either invoke code or invoke method

strArray = strArray.Where(Function(s) s = “toberemove”).ToArray



i had used text2.ToList.RemoveAt(0)

but it say that value does not reproduce a value


Go for the second approach i provided - As said this require to use either invoke method/Code and would only work if you have a list initially.

You cannot remove items from an array, you can only reassign it to a new one.



there is a message:


You need to select the type of the list with the dropdown




I agree with @Florent_Salendres’s solution. You can just basically filter your array to remove the item.
But I think he meant <>, not =

Assign activity: strArray = strArray.Where(Function(s) s <> “toberemove”).ToArray

So you only pull in all items that don’t equal the string.


Indeed :slight_smile: