No1.字符串的魔法

#首字母大寫 >>> test = "trony" >>> v = test.capitalize() >>> print(v) Trony #將字符串中大寫變小寫有兩個方法casefold()和lower(),casefold()更加的牛逼,它能夠將許多未知的字符串變小寫 >>> test = "FDKFJ" >>> v1 = test.casefold() >>> print(v1) fdkf
相關文章
相關標籤/搜索