View Single Post
  #2 (permalink)  
Old 07-30-2007, 07:31 PM
brianhks brianhks is offline
Senior Member
 
Join Date: Jul 2007
Posts: 134
brianhks will become famous soon enough
Integer.parseInt() takes a String and turns it into a number.

To get each character use the String.toCharArray();

For example you can do the following:
Code:
String num = "12345"; char[] arr = num.toCharArray(); for (char n : arr) { int i = Integer.parseInt(n + ""); print(i); }
BTW the n+"" is a shortcut to turn n into a String.
Reply With Quote