How can I detect all empty spaces in a string that are the result of more than one space key being entered.
In other words I don’t wan to detect this:
" "
But anything greater than that. For example:
" ", " ", etc...
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use regex:
\sincludes white space, tabs, and new lines. If you want just spaces, you can change$regexto :If you want to remove extra spaces from a string, you can use:
Outputs: