More Example on String title() Method

Here are some more examples on string title() method, for better understanding:

Example 1: Convert string to title

Python3




print("geeks_for_geeks".title())


Output:

Geeks_For_Geeks

Example 2: Basic usages of String title() Method

Python3




# conversion from mixed case
str1 = 'geeKs foR geEks'
print(str1, 'converted to using title():', str1.title())
 
# conversion from all lower case
str4 = 'geeks for geeks'.title()
print(str4, 'converted to using title():', str4.title())
 
# conversion from all UPPER CASE
str5 = 'WE ARE 1'.title()
print(str5, 'converted to using title():', str5.title())


Output: 

geeKs foR geEks converted to using title(): Geeks For Geeks
Geeks For Geeks converted to using title(): Geeks For Geeks
We Are 1 converted to using title(): We Are 1

Python String Title method

Python String title() method returns a new string after converting the first letter of every word to uppercase(capital) and keeping the rest of the letters lowercase.

Example: Make string title case

Python3




print("usE stRing title Method".title())


Output

Use String Title Method

Similar Reads

String title() Method Syntax

...

What is String title() Method?

string.title()...

More Example on String title() Method

String title() is an in-built function in Python that is used to change text in title format. It converts the first letter of every word to uppercase and other letters to lowercase and then returns this new string....

Limitations of String title() Method

...

Fixing the Limitations of title() Method

Here are some more examples on string title() method, for better understanding:...

FAQ on Python title() method

...