"在Python中使用strip函数" 修訂間的差異

出自 YTYZX有图有真相的百科
前往: 導覽搜尋
(创建页面,内容为“ 1.在Python中可以使用strip去除字符串中特定字符,lstrip用于去除左边的字符,rstrip用于去除右边的字符。 File:PythonStrip1.gif...”)
(無差異)

於 2021年2月14日 (日) 12:23 的修訂

1.在Python中可以使用strip去除字符串中特定字符,lstrip用于去除左边的字符,rstrip用于去除右边的字符。

PythonStrip1.gif

2.使用str1.strip()去除首尾的空白字符(包括空格,换行符等)。

PythonStrip2.gif