python 裏的常見的字符方法串處理

str='Python String function'html 生成字符串變量str='python String function' 字符串長度獲取:len(str) 例:print '%s length=%d' % (str,len(str)) 1、字母處理 所有大寫:str.upper() 所有小寫:str.lower() 大小寫互換:str.swapcase() 首字母大寫,其他小寫:s
相關文章
相關標籤/搜索