Python的字符串处理操作
s = 'hello,world! '
去空格和特殊符号
s.strip()
查找字符
s.index()
比较字符串
cmp(str1,str2) #return -1,0,1
大小写
s.upper()
s.lower()
翻转字符串
str = s[::-1]
查找字符串
s.find()
分割字符串
s.split() #return a list
s = 'hello,world! '
s.strip()
s.index()
cmp(str1,str2) #return -1,0,1
s.upper()
s.lower()
str = s[::-1]
s.find()
s.split() #return a list