c# - When converting a string of numbers to int , it returns Ascii code for the string? -
i have strings in format below: "p100" "p231" "p000" . . .
these strings button names , last 3 characters referring cell of 3d array,and need convert strings integers cell address, 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 don't use "str[0]" because "p".
but when compile code , value of xi,xj,xz ascci values of string characters.
how should convert string int won't happen?
Thanks to the blogger for sharing such explanatory codes.
ReplyDeleteTableau Soap Connection