I want to eliminate all the whitespace from a string, on both ends, and in between words.
I have this Python code:
def my_handle(self): sentence
import re sentence = ' hello apple' re.sub(' ','',sentence) #helloworld (remove all spaces) re.sub(' ',' ',sentence) #hello world (remove double spaces)