specify which characters are to be stripped, by listing them all in a string parameter : Strip « String « Python Tutorial






print '*** SPAM * for * everyone!!! ***'.strip(' *!')
5.34.Strip
5.34.1.The strip method returns a string where whitespace on the left and right (but not internally) has been stripped (removed):
5.34.2.specify which characters are to be stripped, by listing them all in a string parameter
5.34.3.Strip leading and trailing characters