C# - Normalize Whitespace Inside String
· ☕ 2 min read
Simple task - replace all sequential whitespace (tabs, spaces, newlines) with your character of choice, usually a space.
Fact - StackOverflow is on top in google results, when searching for “C# normalize whitespace”.
How to replace multiple white spaces with one white space c# Fastest way to remove extra white spaces Why this article? Highest voted answers are not the best performing, and some answers are just wrong.