Python中title()方法的使用简介,pythontitle
Python中title()方法的使用简介,pythontitle
title()方法返回所有单词的第一个字符大写的字符串的一个副本。
语法
以下是title()方法的语法:
str.title();
参数
- NA
返回值
此方法返回其中所有单词的前几个字符都是大写的字符串的一个副本。
例子
下面的例子显示了title()方法的使用。
#!/usr/bin/python str = "this is string example....wow!!!"; print str.title();
当我们运行上面的程序,它会产生以下结果:
This Is String Example....Wow!!!
相关内容
- python网络编程之文件下载实例分析,
- Python中zfill()方法的使用教程,pythonzfill
- 在Python中处理字符串之isdecimal()方法的使用,pythonisde
- python对数组进行反转的方法,python数组反转
- Python中列表的一些基本操作知识汇总,python基本操作
- python操作mongodb根据_id查询数据的实现方法,mongodb_id
- 简单介绍Python2.x版本中的cmp()方法的使用,python2.xcmp
- 在Python中操作列表之List.append()方法的使用,pythonlist.
- Python中List.count()方法的使用教程,pythonlist.count
- python实现马耳可夫链算法实例分析,python实例分析
评论关闭