Remove Whitespace
Removes all whitespace from a string.
- string
- whitespace
- remove
Code
def remove_whitespace(s):
return ''.join(s.split())Usage
remove_whitespace('hello world') # Returns: 'helloworld'Removes all whitespace from a string.
def remove_whitespace(s):
return ''.join(s.split())remove_whitespace('hello world') # Returns: 'helloworld'