String numString = "12345"; int num = numString.charAt( 2 );
will not assign the value of 3 to num. It will instead assign the decimal ASCII value of the character '3' to num.
You might try something like:
int num1 = Integer.parseInt( "" + num.charAt(0) );

New Topic/Question
Reply




MultiQuote







|