c# - Remove elements in an array containing a certain word/string in a single line of statement -


i have array:

 list<string> tagarray = new list<string>(tagstring.split(',')); 

i want remove elements, in array; - if values contain letter 'aaa'.

is there single line of statement in c# can achieve desired result?

try this:

tagarray.removeall(item => item.contains("aaa")); 

removeall remove items return true predicate define. can multiple time or can || bunch of contains within 1 removeall.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -