Check if any of multiple strings exist in a string
I need to check if any of a set of strings exists in one main string.
Currently I'm using an array with a for loop to check each string.
Is there a simpler way, like this solution for ruby which I've come across
on - How to compare a string against multiple other strings
["string1","string2","string3"].include? myString
No comments:
Post a Comment