python string 处理

  1. strip lstrip rstrip

    字符串里有三个去空格的函数
    strip 同时去掉左右两边的空格
    lstrip 去掉左边的空格
    rstrip 去掉右边的空格

lang: python
1
2
3
4
5
6
7
8

>a=" gho stwwl "
>a.lstrip()
'gho stwwl '
>a.rstrip()
' gho stwwl'
>a.strip()
'gho stwwl'