I have a text string that also includes numbers. Based on where my cursor is within the string, I'm wanting to be able to add <Y> to the beginning of a number and </Y> at the end of a number.
An example text string would be: There are 21 rocks in my collection -- 2 of them are quartz. I want the string to be: There are <Y>21</Y> rocks in my collection -- 2 of them are quartz.
If my cursor is to the left of 21, between the 2 and the 1 or to the right of the 1, I'm looking for a script to put the <Y> in front of the 2 (in 21) and put a </Y> at the end of the 1 as shown in the example. Pretty much, the cursor has to be next to one of the numbers that I want to put <Y> in front of and </Y> behind.
If there is only one number in the text string, I want to do the same thing... put a <Y> in front of the first number and a </Y> behind the last number.
An example text string would be: 2 of my rocks are quartz. I want the string to be: <Y>2</Y> of my rocks are quartz.
As long as my cursor is to the immediate left or right of the 2, I want to put <Y> in front of and </Y> behind the number.
It's just beyond my scope of knowledge.
An example text string would be: There are 21 rocks in my collection -- 2 of them are quartz. I want the string to be: There are <Y>21</Y> rocks in my collection -- 2 of them are quartz.
If my cursor is to the left of 21, between the 2 and the 1 or to the right of the 1, I'm looking for a script to put the <Y> in front of the 2 (in 21) and put a </Y> at the end of the 1 as shown in the example. Pretty much, the cursor has to be next to one of the numbers that I want to put <Y> in front of and </Y> behind.
If there is only one number in the text string, I want to do the same thing... put a <Y> in front of the first number and a </Y> behind the last number.
An example text string would be: 2 of my rocks are quartz. I want the string to be: <Y>2</Y> of my rocks are quartz.
As long as my cursor is to the immediate left or right of the 2, I want to put <Y> in front of and </Y> behind the number.
It's just beyond my scope of knowledge.