Using Contains() Method to check if a string variable contains strings from another string variable

Hello everyone,

I have the following problem : I need to check (using an If statement) if a string variable contains any string value from a List variable. Am I able to do it with the Contains() method? Or is there any method to check?

Thanks a lot!

For Each through the list, and check if your string variable contains each value.

grafik
myListVar.Any(Function(x) myStringVar.Contains(x))

Thank you!

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