Arg.charAt(i)-'0' is an ascii code, which subtracts 0 from the previous ascii code.
For example, arg.charAt(i) represents the character f.
The ascii code of f is 102.
Ascii code 48 of 0
102-48=54
Ascii code 54 stands for character 6 (f ranks sixth among 26 letters).