码迷,mamicode.com
首页 > 编程语言 > 详细

python strip() 方法

时间:2017-11-11 21:30:16      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:print   this   nbsp   view   open   img   code   display   默认   

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() 方法

标签:print   this   nbsp   view   open   img   code   display   默认   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!