I want to retrieve the previous three and next three words of the searched word from a string in java. For example:
I have a string:
A quick brown cat jumped over the lazy dog.
A quick brown monkey move over the lazy dog.
A quick brown monkey jumped over the lazy dog.
And a searched word is : jumped
I want the output as:
quick brown cat jumped over the lazy
quick brown monkey jumped over the lazy