Fork me on GitHub

Python title() 方法

描述

Python title() 方法返回"标题化"的字符串,就是说所有单词都是以大写开始,其余字母均为小写。

语法

title() 方法语法:

S.title()

参数

  • 无。

返回值

返回"标题化"的字符串,就是说所有单词都是以大写开始。

实例

以下实例展示了 title() 方法的使用方法:

#!/usr/bin/python

S = "this is string example from runoob....wow!!!"
print (S.title())

以上实例输出结果如下:

This Is String Example From Runoob....Wow!!!
posted @ 2017-10-18 16:24  IT技术随笔  阅读(2421)  评论(0编辑  收藏  举报
返回顶部↑