Guys if I have a string such as
2WAY002
or
2WAY001
What is the best way to get rid of the characters in the middle of the string and convert them to numbers in Javascript. My initial thoughts was a function to get the position in the alphabet i.e. A=1 and change to a number.
Is there any better way? would parseInt do anything for me? or a regex?
My reason for doing this is that these codes are going into a database from a CSV file...and need to be numeric. I wish to run a javascript parser over the file first and modify the data.
__________________