首页 > 编程语言 > 详细

[Python] String strip() Method

时间:2017-03-23 21:33:32      阅读:240      评论:0      收藏:0      [点我收藏+]

Description

The method strip() returns a copy of the string in which all chars have been stripped from the beginning and the end of the string (default whitespace characters).

在string中删掉strip(char)的所有char字符。

 

Syntax

str.strip([chars])

  

Parameters

  • chars -- The characters to be removed from beginning or end of the string.

 

Return Value

This method returns a copy of the string in which all chars have been stripped from the beginning and the end of the string.

 

Example

str = ‘1111234    adad‘;
print str.strip(‘1‘);

  

Result: 234    adad

  

[Python] String strip() Method

原文:http://www.cnblogs.com/KennyRom/p/6607216.html

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