Python的字符串方法

1:in和not in

uname=""

'linux' not in uname

2:index find

index不存在会产生异常

find不到为-1

3:lstrip()

rstrip()

strip()

删除前导空白,结尾空白和前后空白

可带参数

4:upper和lower

5:split

splitlines

6:join方法

posted @ 2009-12-31 05:16  macula7  阅读(89)  评论(0编辑  收藏  举报