string mystring = "bbbccc ";
How to check if my string contains more than one consecutive whitespace?
I assume you're looking for multiple consecutive whitespaces.
I'd use System.Text.RegularExpressions.Regex for that.
Regex regex = new Regex(@"\s{2,}"); // matches at least 2 whitespaces
if (regex.IsMatch(inputString))
// do something
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