c# how to check if string contains substring code example Example: c# string contains bool b = s1.Contains("myString");