1,138
个编辑
更改
创建页面,内容为“ 1.在Python中可以使用strip去除字符串中特定字符,lstrip用于去除左边的字符,rstrip用于去除右边的字符。 File:PythonStrip1.gif...”
1.在Python中可以使用strip去除字符串中特定字符,lstrip用于去除左边的字符,rstrip用于去除右边的字符。
[[File:PythonStrip1.gif]]
2.使用str1.strip()去除首尾的空白字符(包括空格,换行符等)。
[[File:PythonStrip2.gif]]
[[File:PythonStrip1.gif]]
2.使用str1.strip()去除首尾的空白字符(包括空格,换行符等)。
[[File:PythonStrip2.gif]]