Python title()方法

栏目: 编程语言 · Python · 编程教程 · python 教程 · 发布时间: 8年前

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

描述

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 title()方法》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Test Driven Development

Test Driven Development

Kent Beck / Addison-Wesley Professional / 2002-11-18 / USD 49.99

Quite simply, test-driven development is meant to eliminate fear in application development. While some fear is healthy (often viewed as a conscience that tells programmers to "be careful!"), the auth......一起来看看 《Test Driven Development》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具