参考网址:http://www.tutorialspoint.com/python/pdf/string_strip.pdf
函数描述:
返回一个去掉特殊字符的字符串副本。
语法:
str.strip([chars]);
参数:
chars——需要去掉的特殊字符。从字符串起始至末尾去掉chars。默认去掉字符串中的空格。
例子
#!/usr/bin/python
str = "0000000this is string example....wow!!!0000000";
print str.strip( '0' );
结果:
this is string example....wow!!!