How to ignore the case sensitivity in List

前端 未结 11 881
旧时难觅i
旧时难觅i 2020-11-30 09:46

Let us say I have this code

string seachKeyword = \"\";
List sl = new List();
sl.Add(\"store\");
sl.Add(\"State\");
sl.Add(\"STAM         


        
11条回答
  •  遥遥无期
    2020-11-30 09:57

    One of possible (may not be the best), is you lowercase all of the strings put into sl. Then you lowercase the searchKeyword.

    Another solution is writing another method that lowercase 2 string parameters and compares them

提交回复
热议问题