rstrip的用法

xiaoxiao2021-02-28  59

#!/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
转载请注明原文地址: https://www.6miu.com/read-71974.html

最新回复(0)