python split and remove whitespace code example
Example 1: python 3 replace all whitespace characters
>>> s = " \t foo \n bar "
>>> "".join(s.split())
'foobar'
Example 2: strip whitespace python
>>> s.strip()
'Hello World From Pankaj \t\n\r\tHi There'