I have numbers like 1100, 1002, 1022 etc. I would like to have the individual digits, for example for the first number 1100 I want to have 1, 1, 0, 0.
How can I get
Easier way I think is to convert the number to string and use substring to extract and then convert to integer.
substring
Something like this:
int digits1 =Integer.parseInt( String.valueOf(201432014).substring(0,4)); System.out.println("digits are: "+digits1);
ouput is 2014