Java Integer Create toIntArray(String src)

Here you can find the source of toIntArray(String src)

Description

to Int Array

License

Open Source License

Declaration

public static int[] toIntArray(String src) 

Method Source Code

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

public class Main {
    public static int[] toIntArray(String src) {
        if (src == null || src.length() == 0) {
            return null;
        }//from   w  w w .  j a  v a2  s . co m

        int length = src.length();
        int[] dst = new int[length];

        for (int i = 0; i < length; i++) {
            dst[i] = Integer.parseInt(String.valueOf(src.charAt(i)));
        }

        return dst;
    }
}

Related

  1. toIntArray(Integer[] data)
  2. toIntArray(Integer[] objArray)
  3. toIntArray(long color)
  4. toIntArray(long[] in)
  5. toIntArray(String intArray)
  6. toIntArray(String str, String delimiter)
  7. toIntArray(String str, String separator)
  8. toIntArray(String value)
  9. toIntArray(String[] anArray)