Dividing string into two parts

I need to divide a single string into 2 parts. The first character of the string must be a Letter from A to J. The second part must be a number from 1 to 10. An example of the input would be A8. I need to differentiate a 1 and a 10. I thought I could just do something like this;
1
2
3
4
5
6
7
8
9
string a;     // what is inputted
string b, c;  //what is taken out

b= a[0];     //the first letter, always the first character

if(a[2] = 0)    //checks to see if number is 10
   c = 10;      //makes number 10
else
   c = a[1];    //makes number 1-9 

Thank you. It doesn't necessarily have to be a string, but I need to divide it into two parts.
Last edited on
Topic archived. No new replies allowed.