Repeat the previous exercise, but find the second word in the string. Previous exercise Write some Java

Question:

Repeat the previous exercise, but find the second word in the string.


Previous exercise

Write some Java statements that use the String methods indexOf and substring to find the first word in a string. We define word to be a string of characters that does not include whitespace. For example, the first word of the string

"Hello, my good friend!"

is the string "Hello,"and the second word is the string "my".

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: