I’m making a little text parser in Unity, but I have come to needing to conver a string, containing only numbers, directly into integers, I know that I can do this with a little bit of length code that goes character by character comparing each character to another and returning an integer, but i’m wondering if there is a faster way I can accomplish the task of turning the string “932” into the integer 932.
Use parseInt:
var n: int = parseInt(someString);
There’s also parseFloat for float values.