replace enter with space python code example
Example 1: replace multiple spaces with single space python
' '.join(mystring.split())
Example 2: replacing spaces in a string python
mystring.replace(" ", "_")
' '.join(mystring.split())
mystring.replace(" ", "_")