Both JS and C# strings have an IndexOf method. This returns the character position if the string is matched. If it's not matched it returns -1.
If you want to check in javascript its
stringValue.indexOf('MyString');
If you need to check none case sensitive
stringValue.toLowerCase().indexOf('mystring');
If you want to check with c#
stringValue.IndexOf("MyString");
Again, not case sensitive
stringValue.toLower().IndexOf("mystring");