I am trying to get the first digit of a integer. Example: 21 = 1, 134 = 4 etc.
I am converting the number to a string and getting the number at position 0. If i debug the string, it works fine. However, once I try to convert it to a int again, then the Debug gives me a whole different number. I don’t know what I am doing wrong.
var s : int = 56;
var pos = parseInt(s.ToString()[0]);
This returns the value 53 and not 6. Anyone?