s = 'hello,WORLD'
s.lower() #s变小写 hello,world
s.upper() #s变大写 HELLO,WORLD
s.swapcase() #s的大小写互换 HELLO,world
s.capitalize() #s的首字母大写 Hello,WORLD
s.title() #s 转换为标题格式(每个单词的第一个字母大写) Hello,World
s.join(t) #用 s 连接 t 中的所有字符串
s.replace(old , new [,maxreplace]) #将子串 old 替换为 new
s.strip() #删去字符串s开头和末尾的空白 '\r' '\n' '\t' ' ' 4种都去掉,较为实用
s.split([sep [,maxsplit]]) #将字符串 s 分割成一个字符串列表,其中 sep 为分隔符,maxsplit是最大分割次数
s.translate(table [,deletechars ]) #使用字符转换表转换一个字符串
s.encode([encoding [,errors]]) #改变字符串的编码
s.find(sub [,start [,end]]) #返回子串 sub 首次出现的位置或者 -1
s.startswith(prefix [,start [,end]]) #检查字符串的开头是否为prefix
s.endswith(suffix [,start [,end]]) #检查字符串的结尾是否是suffix