python replace space with nothing code example
Example 1: space to underscore python
mystring.replace(" ", "_")
Example 2: python 3 replace all whitespace characters
>>> s = " \t foo \n bar "
>>> "".join(s.split())
'foobar'
mystring.replace(" ", "_")
>>> s = " \t foo \n bar "
>>> "".join(s.split())
'foobar'