Reformat · Easy

Fix the capitals in names

Names were typed carelessly: all capitals, all small, extra spaces.

Task

Write a prompt that writes each name with a capital first letter on every part.

Output format

one name per line

  • Each word and each part after a hyphen starts with a capital; the rest small.
  • Remove extra spaces.
  • Same order.

Your prompt must contain {input}: it is replaced by each test case, just like the hidden tests in a hiring test.

Sample case 1
Input
aLI hASSAN
Output
Ali Hassan
Sample case 2
Input
  maya   lee  
TOM BROWN
Output
Maya Lee
Tom Brown

There are 4 test cases in all; the others are like hidden tests: work out what tricky inputs they might use!

Loading the editor…