views:

113

answers:

1

Hello,

Is it possible to convert a char[] array containing numbers into an int?

Thanks

~ Kyle.

+7  A: 

Does the char[] contain the unicode characters making up the digits of the number? In that case simply create a String from the char[] and use Integer.parseInt:

char[] digits = { '1', '2', '3' };
int number = Integer.parseInt(new String(digits));
Joachim Sauer