split astring to array java code example
Example 1: split every character in string into array java
String s="abcd";
char[] a=s.toCharArray();
Example 2: split string into array java
String[] array = values.split("\\|", -1);
Example 3: split string by index java
String s ="123456789abcdefgh";
String sub = s.substring(0, 10);
String remainder = s.substring(10);