how to remove space string python code example
Example 1: delete spaces in string python
>>> s.replace(" ", "")
Example 2: python string remove whitespace
' sss d ssd s'.replace(" ", "")
# output: 'sssdssds'
>>> s.replace(" ", "")
' sss d ssd s'.replace(" ", "")
# output: 'sssdssds'