首页 > 编程语言 > 详细

python strip() 方法

时间:2017-11-11 21:11:47      阅读:177      评论:0      收藏:0      [点我收藏+]

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

 

用法 :

 s.strip(‘参数‘)

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

   2 print str.strip(‘0’) 

执行之后的结果

技术分享
this is string example....wow!!!
View Code

 

python strip() 方法

原文:http://www.cnblogs.com/jiayou888888/p/7819868.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!