python strip() 方法

strip() 用于移除 字符串 首尾指定的字符, 默认是移除空格

用法 :

 s.strip('参数')

实例 1 str = "0000000this is string example....wow!!!0000000";

   2 print str.strip(‘0’) 

执行之后的结果

this is string example....wow!!!
View Code
原文地址:https://www.cnblogs.com/jiayou888888/p/7819868.html