Filter Strings from an array

Hi,
I have an array of Strings with differents names. I want to keep in the array only the Strings beginning with the letter “B”. So for example array={“ball”, “chips” , “blue” , “cold”}. At the end I want to have this: array={“ball” , “blue”}.

Anyone knows how I can do that? Do I have to use lists instead of arrays?
Thanks!

Hi
if the input is stored in a variable named variable1 of type array of string
then in Assign activity
variable1 = variable1.AsEnumerable().Where(Function(a) a.ToString.StartsWith(“b”)).ToArray

now this variable1 will have only those values starting with b

Cheers @jadbenn

1 Like
Dim filteredArray = (from s in arr
                     Where s.startswith("b")
                     Select s).ToArray()

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.