Simple sentence
Input
title_case("hello world")
Output
Hello World
Each word's first letter is uppercased and the rest lowercased.
Full lesson preview
Transform each space-separated word so its first character is uppercase and the rest are lowercase, preserving spacing.
Problem statement
Task
Examples
Input
title_case("hello world")
Output
Hello World
Each word's first letter is uppercased and the rest lowercased.
Input format
Output format
Constraints
Samples
Input
title_case(" leading and multiple spaces ")
Output
Leading And Multiple Spaces
Leading, trailing, and multiple spaces are preserved; each non-empty token is title-cased.