[root@localhost /]# cat zifuchuan.py
#!/bin/python
import re
s=' ---asdegsd:34fr++++ '
print(s.strip())
print(s.lstrip())
print(s.rstrip())
print(s[:11]+s[12:])
print(s.replace('-','h'))
print(s.translate(None,'a'))
print(re.sub('a','',s))
[root@localhost /]#
阅读(11683) | 评论(0) | 转发(0) |