문제

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;
{
도움이 되었습니까?

해결책

try this

if(article.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0)
{
//   ....
}
else
{
// .....
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top