Answers for "how to take away white space in a string python"

0

python remove white space

>>> '     hello world!    '.strip() #remove both
'hello world!'

>>> '     hello world!'.lstrip() #remove leading whitespace
'hello world!'
Posted by: Guest on November-23-2021
2

python string remove whitespace

' sss d ssd s'.replace(" ", "")
# output: 'sssdssds'
Posted by: Guest on February-25-2021

Code answers related to "how to take away white space in a string python"

Python Answers by Framework

Browse Popular Code Answers by Language