发布时间:2019-09-21 10:57:02编辑:auto阅读(6074)
字符串里有三个去空格的函数
strip 同时去掉左右两边的空格
lstrip 去掉左边的空格
rstrip 去掉右边的空格
>>>a=" gho stwwl "
>>>a.lstrip()
'gho stwwl '
>>>a.rstrip()
' gho stwwl'
>>>a.strip()
'gho stwwl'
上一篇: 卸载python最干净的办法
下一篇: Python 中的range(),ara
51969
51772
42055
38895
33392
30357
28996
24017
23928
22288
32°
487°
2658°
3354°
2772°
2764°
3543°
2721°
3551°
5855°