Question: In JAVA write a program that inputs a string. Break apart the string into words where words are separated by blanks. Output each word and
In JAVA write a program that inputs a string. Break apart the string into words where words are separated by blanks. Output each word and its length. Be certain to eliminate any commas found in the stringthey are not included in a word.
For example, if the phrase A man, a plan, a canal, Panama were entered, the words and their lengths would be: A 1, man 3, a 1, plan 4, a 1, canal 5, Panama 6. Ensure that your code works properly when an empty string (e.g., ) is entered, and when there is a single word entered (e.g., Hello).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
