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);
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)
Try this code
int c = string.Compare(a, b,true);
true (ignoreCase)