Python Tutorial Python Advanced Python References Python Libraries

Python String - title() Method



The Python title() method is used to convert all characters of the string in title format. A title format consists of first character of every word in uppercase and rest in lowercase. Any symbol, space, special character or number in the string is ignored while applying this method. Only Alphabets are converted.

Syntax

string.title()

Parameters

No parameter is required.

Return Value

Returns the string with all characters of the given string in the title format.

Example:

In the example below, title() method is used to convert all characters of the string in title format.

MyString = "learning python is fun."
print(MyString.title())

The output of the above code will be:

Learning Python Is Fun.

❮ Python String Methods