You can use the IndexOf() method, which takes in a StringComparison type:
string s = "foobarbaz";
int index = s.IndexOf("BAR", StringComparison.CurrentCultureIgnoreCase); // index = 3
If the string was not found, IndexOf() returns -1.
You can use the IndexOf() method, which takes in a StringComparison type:
string s = "foobarbaz";
int index = s.IndexOf("BAR", StringComparison.CurrentCultureIgnoreCase); // index = 3
If the string was not found, IndexOf() returns -1.