Python3 string.capitalize()方法

string.capitalize()方法將字串的第一個字母大寫後並返回這個字串

語法

str.capitalize()

參數

  • NA

返回值

string

示例

#!/usr/bin/python3

str = "this is string example....wow!!!"

print ("str.capitalize() : ", str.capitalize())

結果

str.capitalize() :  This is string example....wow!!!

上一篇: Python3數字 下一篇: Python3字串