Python title()方法

Python 教程 · 2019-02-02 18:56:48

描述

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

语法

title()方法语法:

str.title();

参数

  • NA。

返回值

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

实例

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

#!/usr/bin/python

str = "this is string example....wow!!!";
print str.title();

以上实例输出结果如下:

This Is String Example....Wow!!!

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

Tales from Facebook

Tales from Facebook

Daniel Miller / Polity Press / 2011-4-1 / GBP 55.00

Facebook is now used by nearly 500 million people throughout the world, many of whom spend several hours a day on this site. Once the preserve of youth, the largest increase in usage today is amongst ......一起来看看 《Tales from Facebook》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具