Search and reduce the range of a text selection
For a predefined selection of text, I'd like to:
1. Change the range the selection by first searching for a specific character starting from the start of the selection, and
2. When such a character is found, the range of the selection is reduced(changed) to the position of the character(character inclusive).
3. I'd also like to do 1, 2 but this time starting from the end of the selection, and going backwards.
For example,
if the predefined selection of text is: "Jim, hello there? How are you doing?", and
I wish to find a single space within the text.
After running the macro, the result would be: " hello there? How are you " (white spaces exist on both ends of the selection)
|