String input = "abcdefghijk";
String regex = "(.{2})";
input = input.replaceAll (regex, "$1 ");
System.out.println (input);