#!/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
rstrip的用法
最新推荐文章于 2021-06-08 11:29:45 发布