Hello friends, I have a small problem and I need your help/hint...
I want to compare two strings with ignoring cases but my program not works as I want...
The program should compare if two strings contains same characters ignoring lower/upper and their order...
For example, how should works my program:
string x, y;
x = "daniweb";
y = "bewinad";
// true
x = "daniweb";
y = "DaNiWeB";
// true
x = "daniweb";
y = "daniwebd";
// false
I tried with:
string.Compare(x, y, true)
// and
x.Equals(y, StringComparison.OrdinalIgnoreCase)
// But I got wrong result...
bool b = "HoWdY".Equals("howdy", StringComparison.OrdinalIgnoreCase);
// I got true
bool b = "HoWdY".Equals("yhowd", StringComparison.OrdinalIgnoreCase);
// I got false (should be true)
Someone to help me ?
Thanks