I have this string:
mystring = 'Here is some text I wrote '
How can I substitute the double, triple (…) whitespace chracters with a single space, so that I get:
mystring = 'Here is some text I wrote'
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.
A simple possibility (if you’d rather avoid REs) is
The split and join perform the task you’re explicitly asking about — plus, they also do the extra one that you don’t talk about but is seen in your example, removing trailing spaces;-).