Python知识点(二)

                                                 Python知识点(二)

字符串的一些函数

1.字符串的一些函数

#str.lower(); str.upper() 大小写

#str.split(sep=None) 根据sep分隔字符串形成列表

#str.count(a) 对a进行计数

#str.replace(old,new) 替换

#str.center(width[,fillchar]) 居中

#str.strip(chars) 去掉两侧的chars

#str.join(iter) 在iter变量除最后元素外每一个元素后面增加一个str

2.

猜你喜欢

转载自blog.csdn.net/jly164260234/article/details/83216098