public static String[] stringToStringArray(String src, int length) { //检查参数是否合法 if (null == src || src.equals("")) { return null; } if (length <= 0) { return null; } int n = (src.length() + length - 1) / length; //获取整个字符串可以被切割成字符子串的个数 String[] split = new String[n]; for (int i = 0; i < n; i++) { if (i < (n - 1)) { split[i] = src.substring(i * length, (i + 1) * length); } else { split[i] = src.substring(i * length); } } return split; }