How do I check if a string contains a specific word?

This question’s answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions. Consider: $a=”How are you?”; if ($a contains ‘are’) echo ‘true’; Suppose I have the code above, what is the correct way to write the statement if ($a contains ‘are’)? 3 36

Case insensitive ‘Contains(string)’

Is there a way to make the following return true? string title = “ASTRINGTOTEST”; title.Contains(“string”); There doesn’t seem to be an overload that allows me to set the case sensitivity. Currently I UPPERCASE them both, but that’s just silly (by which I am referring to the i18n issues that come with up- and down casing). … Read more