I\'m trying to brush up on my LINQ by writing some simple extension methods. Is there any better way to write such a function as below that removes a given list of character
try this for terseness
public static string Remove(this string source, IEnumerable chars) { return new String(source.Where(x => !chars.Contains(x)).ToArray()); }
EDIT
Updated to correct it removing duplicates from source