public static void main(String[] args) {
 String replace=“1111111111”;
 String regex = “(.{3})”;
 replace = replace.replaceAll(regex, "$1 ");
 System.out.println(replace);
 }

结果就是:111 111 111 1