What’s the easiest way to parse a string and extract a number and a letter? I have string that can be in the following format (number|letter or letter|number), i.e ’10A’, ‘B5’, ‘C10’, ‘1G’, etc.
I need to extract the 2 parts, i.e. ’10A’ -> ’10’ and ‘A’.
Update: Thanks to everyone for all the excellent answers
Easiest way is probably to use regular expressions.
You can then match it with your string and extract the value from the groups.