9

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;
{
leppie
  • 115,091
  • 17
  • 196
  • 297
user2691544
  • 359
  • 1
  • 4
  • 11

1 Answers1

7

try this

if(article.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0)
{
//   ....
}
else
{
// .....
}
Milad Hosseinpanahi
  • 1,495
  • 12
  • 20