定义:
Python strip() 方法用于移除字符串头尾指定的字符(默认为空格)。
语法:
str.strip([chars]);
返回值:
返回移除字符串头尾指定的字符生成的新字符串。
例子:
>>> str = "0000000this is string example....wow!!!0000000" >>> str.strip('0') 'this is string example....wow!!!'