private static bool IsStopChar(char c) { switch (c) { case ' ': case ',': case '.': return false; default: return true; } }
With this solution, you avoid iterating the collection, allocating memory, initializing, ... Case modification remains easy.
source share