I wanna get string under the caret position programmatically in Eclipse.
I've already seen this link: How to get cursor position in an eclipse TextEditor but in this link, the word(which i want to get) has to selected. In my question it has not to be selected. For example source code is:
class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello, World");
}
}
Imagine the caret is in the middle of the any word in this method. I used |
symbol instead of a caret to explain myself.
Syst|em.out.println("Hello, World");
For this example i have to get the "System" word.
Is there any way to get this?