字符串常用操作之字母处理

.upper()    
.lower()    
.swapcase()    
.capitalize()    
.title()    
 
a='fheGifHF'
print(a.upper())    # 全部大写
print(a.lower())    # 全部小写
print(a.swapcase()) # 大小写互换
print(a.capitalize())   # 首字母大写,其余小写
print(a.title())    # 首字母大写




 
posted @ 2020-05-02 19:10  huangjunlong  阅读(125)  评论(0)    收藏  举报