更改

跳转至: 导航搜索

在Python中使用strip函数

添加275字节, 2021年2月14日 (日) 12:23
创建页面,内容为“ 1.在Python中可以使用strip去除字符串中特定字符,lstrip用于去除左边的字符,rstrip用于去除右边的字符。 File:PythonStrip1.gif...”
1.在Python中可以使用strip去除字符串中特定字符,lstrip用于去除左边的字符,rstrip用于去除右边的字符。
[[File:PythonStrip1.gif]]

2.使用str1.strip()去除首尾的空白字符(包括空格,换行符等)。
[[File:PythonStrip2.gif]]
1,138
个编辑

导航菜单