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

比如:

str = "0000000this is string example....wow!!!0000000";
print str.strip( '0' );
结果:this is string example....wow!!!

str = "0000000this is string 0000example....wow!!!0000000";
print str.strip( '0' );
结果:this is string 0000example....wow!!!

只移除首尾,不移除中间的值


 
 

相关文章:

  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2021-06-08
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-11
  • 2021-07-30
  • 2021-11-29
  • 2021-07-10
相关资源
相似解决方案