Question

I have this if else statement which is assigned to compare results from a text box to a list of context. I am wondering how do i make it such that it is case insensitive ?

value = textbox1.Text;

if (article.contains(value))
{   
    label = qwerty;

}
else
{

     break;
{
Was it helpful?

Solution

try this

if(article.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0)
{
//   ....
}
else
{
// .....
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top