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



1 Like

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:



This syntax is used to delete all the occurrence of the string in the array…

I have the index of the array which is needed to be deleted…

How can I delete particular index in array?


Normally, I use a LINQ method to take all items that meet a condition, but this will remove all items that have the same value, which may not be what you want.

LINQ example:

For each item In itemArray
    newArray = itemArray.Where(Function(i) i <> item).ToArray

where “item” represents each item within the array during a loop… no index needed. You can use an index instead of “item” if you want, but I’m assuming you are running through the array in a loop.

Another way to remove elements in an array is to do it as a List, and use the .Remove() or .RemoveAt()



However, I have not double checked to see if I did that right.

For more ideas on these solutions, refer here:


1 Like

It shows blue mark error like,

Expression does not produce a value

1 Like

I think you need to use Invoke Method instead for RemoveAt

Here is a quick sample:


I assigned the array to a generic List type variable. To convert it back to an array, use .ToArray, but you could just use a List instead if you decide to.



Thank you @ClaytonM … It works!

1 Like