Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python title() method

Python title() method

Python Strings Python Strings


Description

The Python title() method returns a "title-cased" string, meaning all words start with an uppercase letter and all other letters are lowercase (see istitle()).

Syntax

Syntax of the title() method:


str.title();

Parameters

Return Value

Returns a "title-cased" string, meaning all words start with an uppercase letter.

Example

The following example shows how to use the title() function:


#!/usr/bin/python

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

The output of the above example is:


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

Python Strings Python Strings