What is the best way to compare two string without case sensitive using c#? Am using the below codes.
string b = "b";
int c = string.Compare(a, b);
By explicitly specifying it:
int c = string.Compare(a, b, StringComparison.InvariantCultureIgnoreCase)
convert them to lower case then compare, There you go:
string b = "b";
string a = "";
int c = string.Compare(a.ToLower(), b.ToLower());