FunctionRacerProblemsRace

Capitalize Sentence Starts

EasyStringsPython, JavaScript, TypeScript, Java, C++

text is made of lowercase letters, spaces and periods. A sentence starts at the first letter of text and at the first letter after each period; any spaces in between are skipped over. Return text with the first letter of every sentence changed to uppercase and everything else unchanged.

A period that is not followed by any letter (for example the last character) starts no sentence. Spaces and periods are never changed, and there may be several periods in a row.

Example 1

text "hello world. this is it."
returns "Hello world. This is it."

hello starts the text and this is the first letter after the period, so both get a capital.

Example 2

text "one.two"
returns "One.Two"

There is no space after the period, so two starts right after it.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Strings problems