Python3-strip()
来源:互联网 发布:喝咖啡的利弊 知乎 编辑:程序博客网 时间:2024/04/30 08:45
bytearray.strip([chars])
Return a copy of the sequence with specified leading and trailing bytes removed. The chars argument is a binary sequence specifying the set of byte values to be removed - the name refers to the fact this method is usually used with ASCII characters. If omitted or None, the chars argument defaults to removing ASCII whitespace. The chars argument is not a prefix or suffix; rather, all combinations of its values are stripped:
>>> b' spacious '.strip()b'spacious'>>> b'www.example.com'.strip(b'cmowz.')b'example'
关于strip()的几个测试:
print('www.example.com'.strip('cmowz.'))>>>example
print('wwwexamplecom'.strip('cmowz.'))>>>example
print('www.example.com'.strip('mowz.'))>>>example.c
由此可见,strip(’s’)就是将首尾中的s删除,直到不是s的字符
0 0
- Python3-strip()
- Python 学习-----strip()
- strip
- strip
- strip
- 字符串strip()方法注意事项
- Linux之Makefile(strip)
- python小贴士之strip() split()
- python的strip()函数使用
- python中的split() strip() argv
- python strip()、split() (切片)、.join()(合并) 方法
- Python strip lstrip rstrip使用方法(字符串处理空格)
- Python strip lstrip rstrip使用方法(字符串处理空格)
- Python strip lstrip rstrip使用方法(字符串处理空格)
- Python strip lstrip rstrip使用方法(字符串处理空格)
- strip lstrip rstrip使用方法(字符串处理空格)
- nm 提示 no symbol 的问题(strip)
- Codeforces 487b Strip, dp + RMQ(经典)
- 如何构建一个简单链表
- 利用SecureCRT的VBScript进行自动化控制
- UWP入门(六)-- ResourceDictionary 和 XAML 资源引用
- SSL P2384 2014年初中竞赛试题(南海) 字符串
- 用MyBatis拦截器记录SQL执行时间
- Python3-strip()
- GYM 101147 F.Bishops Alliance(dp+BIT)
- 交换排序
- UVALive 4225 Prime Bases 贪心
- gmapping链接收集
- ACM程序设计题目 Problem M-13
- Sublime Text 设置
- 栈的链式存储结构操作及实现
- POJ