Python String Title method
Title function in python is the Python String Method which is used to convert the first character in each word to Uppercase and remaining characters to Lowercase in string and returns new string.
Syntax:
str.Title() parameters:str is a valid string which we need to convert. return: This function returns a string which has first letter in each word is uppercase and all remaining letters are lowercase.
# Python Title() Method Example str1 = 'geeKs foR geEks'str2 = str1.title() print 'First Output after Title() method is = ', str2 # observe the original string print 'Converted String is = ', str1.title() print 'Original String is = ', str1 # Performing title() function directly str3 = 'ASIPU pawan kuMAr'.title() print 'Second Output after Title() method is = ', str3 str4 = 'stutya kUMari sHAW'.title() print 'Third Output after Title() method is = ', str4 str5 = '6041'.title() print 'Fourth Output after Title() method is = ', str5 |
chevron_right
filter_none
Output:
First Output after Title() method is = Geeks For Geeks Converted String is = Geeks For Geeks Original String is = geeKs foR geEks Second Output after Title() method is = Asipu Pawan Kumar Third Output after Title() method is = Stutya Kumari Shaw Fourth Output after Title() method is = 6041
Recommended Posts:
- Python String Methods | Set 1 (find, rfind, startwith, endwith, islower, isupper, lower, upper, swapcase & title)
- numpy string operations | title() function
- Python | Pandas Series.str.lower(), upper() and title()
- Python string | capwords() method
- Python String | islower() method
- Python String | lstrip() method
- Python String | isupper() method
- Python | Check if given string can be formed by concatenating string elements of list
- String slicing in Python to check if a string can become empty by recursive deletion
- Python | Check if string ends with any string in given list
- Python | Sorting string using order defined by another string
- Python | Check if a given string is binary string or not
- String slicing in Python to rotate a string
- Python String
- Python String | max()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



