Check if string array contains item(s) starting with specific character

Hi Experts

Is there a way to return TRUE or FALSE if an item in myArray starts with a specific character? E.g.

myArray contains the following items:
Apple
Banana
Lemon
Pear
Peach

The check should be if any of the items starts with “P” returning TRUE as Pear and Peach starts with a “P”. The bool should be FALSE if checking for items starting with “M”.

Think I found a solution:

Array.Exists(myArray, Function(x) x.StartsWith(“P”))

1 Like

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