Skip to main content

Capitalize Words

EasyString

Description

Given a string s of lowercase words separated by single spaces, return the string with the first letter of every word capitalized.

Examples

Input:s = "the quick brown fox"
Output:"The Quick Brown Fox"
Explanation:

Uppercasing the first letter of every word produces "The Quick Brown Fox".

Input:s = "hello world"
Output:"Hello World"
Explanation:

Uppercasing the first letter of every word produces "Hello World".

Input:s = "dev eval"
Output:"Dev Eval"
Explanation:

Uppercasing the first letter of every word produces "Dev Eval".

Constraints

  • 1 ≤ s.length ≤ 10⁴
  • Words are separated by single spaces.

Ready to solve this problem?

Practice solo and sharpen your skills for technical interviews.