rstrip的用法
#!/usr/bin/python
# -*- coding:utf-8 -*-
str = " this is string example....wow!!! ";
print str.rstrip();#這個就是沒有刪除任何的字符
str = "88888888this is string example....wow!!!8888888";
print str.rstrip('8');#刪除上面字符串末尾的8
總結(jié)
- 上一篇: fasttext初步使用
- 下一篇: The disk contains an