I have strings which are in a format below: "p100" "p231" "p000" . . .
these strings are button names and the last 3 characters are referring to a cell of a 3D array,and I need to convert those strings to integers to get the cell address, I use this:
string str = clickedButton.Name.ToString();
int xi ;
int xj;
int xz;
xi = Convert.ToInt32(str[1]);
xj = Convert.ToInt32(str[2]);
xz = Convert.ToInt32(str[3]);
please note that I don't use "str[0]" because it is "p".
but when I compile my code , the value of xi,xj,xz are the Ascci values of the string characters.
how should I convert string to int so that it won't happen?