Python笔记——string.strip()
2014-05-27 20:21
309 查看
参考网址:http://www.tutorialspoint.com/python/pdf/string_strip.pdf
函数描述:
返回一个去掉特殊字符的字符串副本。
语法:
str.strip([chars]);
参数:
chars——需要去掉的特殊字符。从字符串起始至末尾去掉chars。默认去掉字符串中的空格。
例子
结果:
this is string example....wow!!!
函数描述:
返回一个去掉特殊字符的字符串副本。
语法:
str.strip([chars]);
参数:
chars——需要去掉的特殊字符。从字符串起始至末尾去掉chars。默认去掉字符串中的空格。
例子
#!/usr/bin/python str = "0000000this is string example....wow!!!0000000"; print str.strip( '0' );
结果:
this is string example....wow!!!
相关文章推荐
- Python_API_String Services_string.strip
- 关于python字符串string的strip函数的诡异现象
- python string format笔记
- python学习笔记:extend和apend;strip,split,filter,map
- python字符串string笔记
- Python学习笔记二(String字符串操作)
- Python笔记--String、list、dict排序
- python3.4学习笔记(二十) python strip()函数 去空格\n\r\t函数的用法
- python3.4学习笔记(十五) 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- Python学习笔记3-string
- python学习笔记(三)——string
- python 系统学习笔记(二)---string
- python,string,strip,split,join,sub
- [python 笔记2]列表、字符串、字典(list?string?map?)
- Python笔记——string.split()
- python 学习笔记之string
- Python学习笔记--字符串操作string
- 一、PYTHON 学习笔记之 strip lstrip rstrip
- python 内建函数basestring笔记
- Python笔记--String