I am looking for something similar to CharFromPos() from MFC that returns the text to the left of the editor.
One idea that I had was to get the selectionStart & selectionEnd position and use the substring() function to get the text, however, I've not been successful at getting the selectionStart.
Any ideas? Please share
thanks,
adico
One idea that I had was to get the selectionStart & selectionEnd position and use the substring() function to get the text, however, I've not been successful at getting the selectionStart.
Any ideas? Please share
thanks,
adico
Re: Get text from cursor position
Thanks in advance for your help.
Re: Get text from cursor position
To use it, simply call getCharFromPos and pass in your current editor.
i.e: var strText = getCharFromPos(myEditor);
I welcome suggestions & feedback.
Thanks,
adico