s = ' Hello World From Pankaj \t\n\r\t Hi There ' >>> s.replace(" ", "") 'HelloWorldFromPankaj\t\n\r\tHiThere'