Advertisement
ivandrofly

C# aggregate example

Jul 19th, 2023
1,107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1.         public static string RemoveInvalidCharacters(this string str, IEnumerable<char> invalidChars)
  2.         {
  3.             return invalidChars.Aggregate(str, (current, ch) => current.Replace(ch.ToString(), string.Empty));
  4.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement