String Feature for Extra White Space removal inside string #120014
Unanswered
junaidmifti
asked this question in
General
Replies: 0 comments 1 reply
-
This is not a C# language feature, neither I don't expect it to get strong interest. Trimming characters in the middle is more complex than trimming from stard/end, and the definition of "whitespace" is also complex in term of Unicode. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have been using C# and the likes of trim(), .toLower() has been of great use. But sometimes to trim extra spaces inside the string, which in my work is needed to done a lot, we need to go to the regex route or method extension.
If we could have a method called "NormalizeWhiteSpace()" which could normalize like below:
Original string: 'Hello World! How are you?'
Cleaned string: 'Hello World! How are you?'
Let me know what do you think? Thanks a lot. Happy to contribute.
Beta Was this translation helpful? Give feedback.
All reactions