Hi, I do not know what is the best way to pass from a string to int, I have a string like this one : “PL” (example : 23PL4) and I want to have 2 int : int1 and int2 (23 and 4).
Some ideas ?
Thank you !
Hi, I do not know what is the best way to pass from a string to int, I have a string like this one : “PL” (example : 23PL4) and I want to have 2 int : int1 and int2 (23 and 4).
Some ideas ?
Thank you !
Look into string.Split and int.Parse or int.TryParse
Well, there’s String.Split(“PL”), that should give you the 2 numbers in int format in an array like so:
splitstring = {“23”, “4”}
then you can simply parse them:
int int1 = int.Parse(splitstring[0]);
int int2 = int.Parse(splitstring[1])