← Unit 1 · all exercises
Saved in this browser only

Initials

Given a first and last name, return the initials in capitals with a full stop after each. "Ada" and "Lovelace" become "A.L." — the names may arrive in any mix of upper and lower case.

String initials(String first, String last)

Solution.java
Loading editor…
Results

Examples

  • initials(Ada, Lovelace) → A.L.
  • initials(grace, hopper) → G.H.lower case in, capitals out

There are also 4 hidden tests you can't see. Solve the problem, not the examples.