语法
strip()方法语法:
str.strip([chars]);
参数
chars – 移除字符串头尾指定的字符序列。
返回值
返回移除字符串头尾指定的字符生成的新字符串。
ps 有趣的是 例:
str = 'hillo'
str.strip('hh') # 返回‘illo’
语法
strip()方法语法:
str.strip([chars]);
参数
chars – 移除字符串头尾指定的字符序列。
返回值
返回移除字符串头尾指定的字符生成的新字符串。
ps 有趣的是 例:
str = 'hillo'
str.strip('hh') # 返回‘illo’