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
Post a Comment