0
Num = num + s.charAt(0)-'0';
Why substraction of char '0'
4 Réponses
+ 3
char codes:
'0' : 48
'1' : 49
'2' : 50
...
digit char - '0' == numeric digit
+ 1
to get numeric value of digit from its char code ^^
0
I am not getting you
Why substraction of char '0'