← Unit 1 · all exercises
Saved in this browser only

Put a name together

Return the first and last name joined with a single space between them, with any stray spaces around either name removed first.

String fullName(String first, String last)

Solution.java
Loading editor…
Results

Examples

  • fullName(Ada, Lovelace) → Ada Lovelace
  • fullName( Grace , Hopper ) → Grace Hopper

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