Spaced Out Replacement
by in CodeSOD on 2024-05-06You have some text, and need to replace every sequence of spaces with a single space. E.g., My text
becomes My text
. Now, if you're most of us, you ignore the famous quote and reach straight for regexes.
But Samuel's co-worker isn't most of us.