How to ignore the case sensitivity in List

前端 未结 11 926
旧时难觅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

    For those of you having problems with searching through a LIST of LISTS, I found a solution.

    In this example I am searching though a Jagged List and grabbing only the Lists that have the first string matching the argument.

    List> TEMPList = new List>();
    
    TEMPList = JaggedList.FindAll(str => str[0].ToLower().Contains(arg.ToLower()));
    
    DoSomething(TEMPList);
    

提交回复
热议问题