示例示例strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。代码示例:
strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。
代码示例:
str = "0000000this is string example....wow!!!0000000";
print (str.strip( '0' ))
输出结果:
this is string example....wow!!!
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(50条)