Capitalize Words in Text

  • Share this:

Code introduction


Capitalize the first letter of each word in the input string.


Technology Stack : String splitting, string joining, string capitalizing

Code Type : String processing

Code Difficulty : Intermediate


                
                    
def capitalize_first_letter_of_each_word(text):
    return ' '.join(word.capitalize() for word in text.split())