吾生也有涯,而知也无涯。

导航

String的方法capitalize

官方解释:Return a copy of the string with its first character capitalized and the rest lowercased.(返回字符串的副本,其首字符大写,其余字符小写。)

  • 使用方法:
>>> s1 = 'python最牛掰'
>>> ret1 = s1.capitalize()
>>> print(ret1)
Python最牛掰

posted on 2018-11-28 19:21  JesseChang  阅读(602)  评论(0编辑  收藏  举报