SyntaxFix
Write A Post
Hire A Developer
Questions
You don't have to use substring(...). Use temp.charAt(i) to get a digit and use the following code to convert char to int.
substring(...)
temp.charAt(i)
char
int
char c = '7'; int i = c - '0'; System.out.println(i);