Are .NET string functions like IndexOf(\"blah\")
case sensitive?
From what I remember they aren\'t, but for some reason I am seeing bugs in my app where the
Yes, string functions are case sensitive by default. They typically have an overload that lets you indicate the kind of string comparison you want. This is also true for IndexOf. To get the index of your string, in a case-insensitive way, you can do:
string blaBlah = "blaBlah";
int idx = blaBlah.IndexOf("blah", StringComparison.OrdinalIgnoreCase);