java split string by 2 characters code example
Example 1: java split for multiple characters
String input = "Hi,X How-how are:any you?";
String[] parts = input.split("[\\W]");
Example 2: split string 2 characters java
String str= "abcdef";
String[] array=str.split("(?<=\\G.{2})");
System.out.println(java.util.Arrays.toString(array));