Any one know how to remove excessive whitespace from a string?
For example:
string myString = "I am going to work.";
Anyone know a good script for doing this kind of trimming?
Regex.Replace(myString, @"\s+", " ")
would do it.
Regex.Replace(myString, @"\s+", " ")
ought to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With