๐Ÿ“ฆ Ops

The Badge Printer

Stardate 55107.4 ยท UES Magnanimous

Briefing

There is a diplomatic reception on Thursday, and the badge printer has produced forty-one badges in exactly the case and spacing each crew member typed into the form. Three badges have leading spaces. One is entirely lower case. Ensign Tannenbaum's reads "bo!!!", and he has been asked not to do that again.

The Captain's badge says "  yves  ". He would like it to say "YVES", and he would like it before the ambassador arrives.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขLeading and trailing spaces removed
  • โ€ขLower case becomes upper case
  • โ€ขAlready-clean input passes through unchanged
  • โ€ขBoth problems at once
  • โ€ขSpaces inside the name are kept, only the ends are trimmed
Ask Commander Raghunathan for a hint

Two string methods, chained. One trims whitespace from the ends, one changes the case. The order does not matter here, but the third objective is worth reading twice: internal spaces stay.