を整数に:str.charAt(i) - '0'
が考慮され、それが何をするのか、なぜアスキーは、私は次のスニペットについて質問があり
while (str.length() > i && str.charAt(i) >= '0' && str.charAt(i) <= '9') {
result = result * 10 + (str.charAt(i) - '0');
i++;
}
は、誰かが私に教えてもらえますか? また、結果に10を掛けた理由は何ですか?
ありがとうございます!
[なぜint型数字に '0'を追加するとchar型への変換が可能になるのですか?](http://stackoverflow.com/questions/24422178/why-does-adding-a-0-to- int-digit-allow-a-charへの変換) – Joe