[Python] String strip() Method
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Python] String strip() Method相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章