c# contains ignore case code example
Example 1: c# string equals ignore case
string.Equals(val, "astringvalue", StringComparison.OrdinalIgnoreCase)
Example 2: C# how to ignore case
if (val.Equals("astringvalue", StringComparison.InvariantCultureIgnoreCase))
Example 3: How to make String.Contains case insensitive?
Assert.IsTrue(text.ToUpper().Contains("Sample".ToUpper()));