C# code for string comparision
//string comaparision
string strval1 = "shivu";
string strval2 = "SHIVU";
//dont use this like this code, bec here two instences of string will created
//at the time of ToUpper method
if (strval1.ToUpper().Equals(strval2.ToUpper()))
Trace.Write("matching");
else
Trace.Write("not matching");
//Put this code instead of above code.
if (strval1.Equals(strval2, StringComparison.InvariantCultureIgnoreCase))
Trace.Write("matching");
else
Trace.Write("not matching");
Hello
it is good habit to either check with toUpper() or toLower().
and you must Trim() a string before it is process.
Thanks
Umesh Bhosale