Title case is a style of writing that is used for the titles of articles, books, movies, and other works. The rules for writing in title case are:
1) Always capitalize the first word.
2) Capitalize all words except the following parts of speech:
- articles – a, an, the
- coordinating conjunctions – and, but, for, nor, or, so, yet
- short prepositions – to, in, up, from etc
Input : The quick brown fox jumps over the lazy dog. Output : The Quick Brown Fox Jumps over the Lazy Dog. Input : A tale of two cities Output : A Tale of Two Cities
- Make a list of all the words that have to be in lower case.
- For every word in the input, check whether it is in the above list or not.
- If yes then ignore the word, if no then capitalize its first character.
The implementation of the above algorithm is:
The Quick Brown Fox Jumps over the Lazy Dog. A Tale of Two Cities
- Python program to convert camel case string to snake case
- Python - Convert Snake case to Pascal case
- Python regex to find sequences of one upper case letter followed by lower case letters
- Python | Convert case of elements in a list of strings
- Python String Methods | Set 1 (find, rfind, startwith, endwith, islower, isupper, lower, upper, swapcase & title)
- Python String Title method
- Pandas - Convert the first and last character of each word to upper case in a series
- numpy string operations | title() function
- Python | Case Counter in String
- Python - Specific case change in String List
- Python - Case Insensitive string counter
- Python | Pandas Series.str.lower(), upper() and title()
- How to get title of a webpage using Selenium in Python?
- Python - Obtain title, views and likes of YouTube video using BeautifulSoup
- Python IMDbPY – Getting title from searched movie
- Matplotlib.pyplot.title() in Python
- title driver method - Selenium Python
- turtle.title() function in Python
- Python VLC MediaPlayer - Getting Full Title Description
- Python VLC MediaPlayer - Getting Title Description
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.