Java String Split splitIntegerPerDigit(int i)

Here you can find the source of splitIntegerPerDigit(int i)

Description

split Integer Per Digit

License

Open Source License

Declaration

public static List<Integer> splitIntegerPerDigit(int i) 

Method Source Code

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

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<Integer> splitIntegerPerDigit(int i) {
        // Splits an integer into corresponding array of numbers.
        // http://stackoverflow.com/questions/5196186/split-int-value-into-seperate-digits
        List<Integer> digits = new ArrayList<Integer>();
        while (i > 0) {
            digits.add(i % 10);/*from  w w w .  j  a  v a2 s  .co  m*/
            i /= 10;
        }
        return digits;
    }
}

Related

  1. splitIdKeyConfig(String config)
  2. splitInitialItems(final String text)
  3. splitInput(String cliInput)
  4. splitIntArray(final String iInput)
  5. splitIntegerFromString(String str)
  6. splitIntoPackages(String stmt)
  7. splitIntoPairs(String subDirName)
  8. splitInts(String str)
  9. splitJsonObjects(String string)