Python title() Method

Python 字符串Python Strings


Description

The Python title() method returns a "titlecased" string, meaning that all words start with an uppercase letter, and the remaining letters are lowercase (see istitle()).

Syntax

Syntax of the title() method:

str.title();

Parameters

  • NA。

Return Value

Returns a "titlecased" string, meaning that all words start with an uppercase letter.

Examples

The following example demonstrates the usage of the title() function:

#!/usr/bin/python

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

The output of the above example is as follows:

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

Python 字符串Python Strings

Other Extensions