Reputation: 8098
i have:
List<string> MyFiles
i need to delete everything from this list that has a specific string inside of it
for example if the list was:
alex1
alex123
alex234
alex345
and i would like to delete every element in this list that has the string "1" in it?
Upvotes: 2
Views: 279
Reputation: 20415
Does this work for you?
C#
MyFiles.RemoveAll((string s) => s.Contains("1"))
I code in VB.NET:
MyFiles.RemoveAll(Function(s As String) s.Contains("1"))
Upvotes: 1