崔甯甯Python 字串String 內建built-in 方法Methods
w3school學習截圖 w3school學習程式碼 z = "崔甯甯很快樂" b = z.replace("快樂","happy") print (z) print (b) print ("幾個很?", z.count("很")) print ("很在0,1..位置", z.find("很")) print ("很在0,1..位置", z.rfind("很")) print ("z的長度", len(z)) txt = "hello,將第一個字母轉成大寫" x = txt.capitalize() print (x) print (txt.casefold()) y = txt.center(20) print (y) print (len(y))