how to split a string every characters java code example
Example 1: split every character in string into array java
String s="abcd";
char[] a=s.toCharArray();
Example 2: split string 2 characters java
String str= "abcdef";
String[] array=str.split("(?<=\\G.{2})");
System.out.println(java.util.Arrays.toString(array));