Ignore cases in strings
private void listboxOP_SelectedIndexChanged(object sender, EventArgs e)
{
String tempValue;
foreach (Object obj in listboxOP.SelectedItems)
{
tempValue = (String)obj;
if (tempValue == "Employee data")
{
//perform some operations
}
}
}
My program should handle the case sensitive.
Even if user enters "employee data" in Upper case or lower case or combination of both uppercase and lowercase ,It should enter the loop.
How can i handle case-sensitiveness?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Apr 23, 2010, 3:37 AM EDT
{
//perform some operations
}
Jaish MathewsRank #225 · 11K reputationPosted Apr 23, 2010, 3:13 AM EDT
if (String.Compare(tempValue,"Employee Data",true) == 0)
{
}