博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Python] String strip() Method
阅读量:7060 次
发布时间:2019-06-28

本文共 592 字,大约阅读时间需要 1 分钟。

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

  

转载于:https://www.cnblogs.com/KennyRom/p/6607216.html

你可能感兴趣的文章
浅谈gibbs sampling(LDA实验)
查看>>
Asp.net 后台添加CSS、JS、Meta标签
查看>>
JDBC连接SQL Server2008基本格式及示例代码 (转载收藏~)
查看>>
以前的GHOST系统没落,现在 原版WINDOWS更新节奏还快 MSDN itellyou
查看>>
scala学习手记21 - 传递变长参数
查看>>
一些JavaScript中的DOM的优化小技巧
查看>>
用PrintStream向文件输入内容
查看>>
412. Fizz Buzz
查看>>
Uva 10879 - Code Refactoring
查看>>
控制总线上发送的控制信息
查看>>
c#解析xml
查看>>
每日一句(15)
查看>>
读书笔记--SQL必知必会--建立练习环境
查看>>
捕获、冒泡
查看>>
C# 递归获取 文件夹的 所有文件
查看>>
ubuntu server 安装java
查看>>
P3369 【模板】普通平衡树(Treap/SBT)
查看>>
陶哲轩实分析例8.4.2
查看>>
Elementary Methods in Number Theory Exercise 1.5.5
查看>>
「陶哲軒實分析」 習題 3.5.1
查看>>