Campbell Ritchie wrote:Welcome again. I have added the code tags as described here, and it looks a lot better.
You can try the numericValue method of the Character class, but you are better using the Integer class method which parses a String to an int. Then you need to know how to iterate the individual digits, possibly best done with a combination of the % and / operators.
I'd probably do it this way:
1. Iterate each character of the String
2. parse each String character to, for example int x
3. Add the x to int total
But I'd like to know how to iterate each int digit using the % and / operators.