Java Integer to intToDigits(int n)

Here you can find the source of intToDigits(int n)

Description

int To Digits

License

Open Source License

Declaration

public static int[] intToDigits(int n) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int[] intToDigits(int n) {
        String s = String.valueOf(n);
        int size = s.length();
        int[] retval = new int[size];
        for (int i = 0; i < size; i++) {
            retval[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }/*  w  w  w  .  j a  v a  2  s .  c  o m*/
        return retval;
    }
}

Related

  1. intToCols(int i)
  2. intToColumnName(int column)
  3. intToDateString(int i)
  4. intToDay(int d)
  5. intToDegree(int storedInt)
  6. intToDouble(int coordinate)
  7. intToDouble(int[] input)
  8. intToDouble100000(int i)
  9. intToDoubleArray(int[] labels)