i have list list<string> paths.
c:\dir\test\ c:\mydir\ c:\yourdir\ c:\dir\ i want go through elements (using linq) , remove entries started other element list.
in example c:\dir\test\ starts c:\dir\ - want remove c:\dir\test\.
use list<t>.removeall() method:
sourcelist.removeall(x => sourcelist.any(y => x != y && x.startswith(y)));
Comments
Post a Comment