This is a rather clumsy workaround, but should achieve the right results. Find the substring you are looking for within the string, and find the charachters before and after your substring. Check these using their ascii values (int)substring.charAt(x);
to see if they are letters or not. If they are both eithr not letters, or fall outside the bounds of the string, you know you have found a word. Otherwise, you know that it is simply part of a word.
The logic will be very long- which is why I am not coding it for you, but give this a shot and let me know if you need clarification.