cut off white space python string code example
Example 1: python delete white spaces
sentence = ' hello apple'
sentence.strip()
>>> 'hello apple'
Example 2: how to strip white space of text in python?
sentence = ' hello apple'
" ".join(sentence.split())
>>> 'hello apple'