Hey
I want to remove all strange whitespaces (such as Alt+0160) except the actual space, as in spacebar.
How can I do this?
Hey
I want to remove all strange whitespaces (such as Alt+0160) except the actual space, as in spacebar.
How can I do this?
new String(stringVariable.Where(c => !char.IsWhiteSpace(c) || c.Equals(' ').ToArray());
Substitute stringVariable
for the actual variable of your existing string. This will return you a string with all whitespace except for spacebar removed.
In ddanbe's defense, he replied with appropriately the right information given what you had posted. However, seeing your other post and that you're an active forum member, I decided to give a more direct answer.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.