Python String title() Method


Contents

Description

The title() method in Python String is supposed to return a copy of the string where the first character of every word is capitalized. Title function in python programming refers to the Python String Method which can be used for converting the first character in every word to Uppercase and the remaining characters into Lowercase within a string and then it returns a new string.

Syntax

Here is the syntax for title() method:

str.title();

Parameters

  • NA

Return Value

This method in Python string returns a copy of the string where the first character of all the words have been capitalized.

Example

The example below shows the usage of title() method.

#!/usr/bin/python

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

When the above above program is run, it produces the following result:

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

Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.



Navigation
Tutorial
Tutorial
Tutorial