how to remove spaces from edge of strings python code example Example: strip whitespace python >>> s.strip() 'Hello World From Pankaj \t\n\r\tHi There'