how to use String.strip()
来源:互联网 发布:学生平板电脑推荐知乎 编辑:程序博客网 时间:2024/05/01 01:02
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).
Syntax
Following is the syntax for strip() method
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
The following example shows the usage of strip() method.
#!/usr/bin/pythonstr = "0000000this is string example....wow!!!0000000";print str.strip( '0' );
Let us compile and run the above program, this will produce the following result:
this is string example....wow!!!reference:http://www.tutorialspoint.com/python/string_strip.htm
- how to use String.strip()
- How to use libcurl in C++ with std::string
- how to strip a shared library
- How To Use DataGird
- how to use typedef
- how to use gz
- How to use chkconfig
- How to use ,,,,
- how to use dialog
- How to use UIDs
- How to use dmalloc
- How to use abld
- How to use BSTR
- How to use Ant
- how to use mstsclib
- how to use gcc
- how to use thread
- how to use ffmpeg
- 服务集成平台性能测试与优化(应用与环境)
- 大清洗
- linux下python学习笔记(十六)
- Java语言的优越性
- GB28181 SIP视频监控系列之 报警事件流程
- how to use String.strip()
- myesclipse配置hibernate
- 大流量数据异步输出
- 虚拟机上安装的Linux从Windows本机提取文件的几种方式及注意事项
- GB28181 SIP视频监控系列之 设备信息查询
- Tcl-debug install guid
- Design Pattern_Observer(观察者模式)
- LocalActivityManager
- 30岁之前需要知道的10个人生底线,你知道几个?