How to remove elements of a list where its string contains sub strings from another list

前端 未结 1 570
萌比男神i
萌比男神i 2021-01-28 18:35

I have a string like this:

var str = \"DAVID CORPORATION\"

then i have a list of substrings that i dont want in the str.

var de         


        
1条回答
  •  猫巷女王i
    2021-01-28 19:05

    You can do the following using Any:

    strList.RemoveAll(x => describers.Any(d => x.Contains(d)));
    

    0 讨论(0)
提交回复
热议问题