Cut off digit from Integer

Hi,

I have a list of postcodes and I wanna cut off the first digit of each code.
If I have the postcodes “85463” for example, I want to cut off the “8” and write it into a variable.

Is that possible? The substring() function won’t work since I’m working on an Integer.

Thanks,
Daniel

println(85463/10000);  //Testing 5 digits

println(10/10000);  //Testing less than 5 digits

Output

8
0

Kf

1 Like
int code = 85463;
char firstDigit = str(code).charAt(0);

println(firstDigit); // 8
exit();
1 Like