With regard to String handling in Java. The Funworks textbook has exercise 3.3.

In this exercise you are required to write Java String handling code that will . . .

  1. Find the first and last characters of a String.
  2. Print the String backwards.
  3. Sequentially harvest letters from the front and the end of the String until there are no more letters left.
  4. Find the middle character or characters of a String.
  5. Print out only the vowels in a String.
  6. Count the number of spaces in a String.

To do this one needs the following String handling methods – length, charAt, substring, indexOf, contains which are used used with conditional statements and for loops.

Click here for the solution.