Search⌘ K

A Problem Solved: Processing a String

Explore how to process a person's name string in Java by reading input, trimming spaces, extracting first and last names, and forming initials. Learn to apply string manipulation methods within classes and objects to solve practical programming problems.

We'll cover the following...

Problem statement

Read a person’s name, compute its length, and identify the first and last names and the person’s initials. If the name is typed on one line, insist that only one space occur between the ...