split number java

Solutions on MaxInterview for split number java by the best coders in the world

showing results for - "split number java"
Camilo
07 Jan 2019
1int num = 5542;
2String number = String.valueOf(num);
3for(int i = 0; i < number.length(); i++) {
4    int j = Character.digit(number.charAt(i), 10);
5    System.out.println("digit: " + j);
6}
7