I have an arraylist that contains 3 Strings.
ArrayList<String> sentences = new ArrayList<String>();
sentences.add("it would be for his happiness and having some feelings himself");
sentences.add("a plan to promote the happiness of all she and Mr" );
sentences.add("a most unreasonable degree of happiness She must wait a moment");
for(String f : sentences){
System.out.println(f);
}
Has the output
it would be for his happiness and having some feelings himself
a plan to promote the happiness of all she and Mr
a most unreasonable degree of happiness She must wait a moment
The MIDDLE word in each sentence is "happiness"
I need the output on the screen to be in the form
it would be for his happiness and having some feelings himself
a plan to promote the happiness of all she and Mr
a most unreasonable degree of happiness She must wait a moment
Where the word happiness is positioned centrally neatly underneath each other with the rest of the sentence around it. Any help is welcome