Name

strip

Synopsis

                     s.strip(x=None)

Returns a copy of s with both leading and trailing whitespace removed. Since Python 2.2.2, you can optionally pass a string x as an argument, in which case strip removes characters found in x rather than removing whitespace.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.