I need to change the text as this is outputting as y2015
while it should only be 2015
and the thing this will be within a set of select option
and they could be dynamic as per y2012 y2013 y2014
So basically this
<select>
<option>y2013</option>
<option>y2014</option>
<option>y2015</option>
</select>
Should become
<select>
<option>2013</option>
<option>2014</option>
<option>2015</option>
</select>
I have found a question called How to see if string contains substring which may help but I cannot figure out how to use it for my case.
It basically says to use if (str.indexOf("Yes") >= 0)
which could work as i could say something like if (str.indexOf("Y2") >= 0)
and then use subtring(1);
The y+number is needed for my web address, I am changing the address for the history and if it uses numbers only it gets confused. I have found out that by adding a letter before the number that would fix the address issue therefore I cannot output numbers only as per 2015
etc.
Also notice that this is not my only dropdown and I cannot provide a specific class just for this one, so i cannot target it directly otherwise it would have been much easier.