Suppose, I have a string
String advise = "eat healthy food";
Now my question is that :- In the string I only know the keyword healthy
. I don't know what has before the word nor what has after the word. I just only know the middle word. So how can I get the before (eat) and after (food) keyword of "healthy"?
Note: Here the middle word's size is always specfic but the other two word's size is always different. Here 'eat' and 'food' have been used for an example only. These two words may be anything anytime
Also for note: I need to get these two words into two different string. Not in a same String.