Question : java split string by length
Answered by : florian-barth
String[] strings = "Thequickbrownfoxjumps".split("(?<=\\G.{4})"); // split all 4 chars
String[] strings = "Thequickbrownfoxjumps".split("(?<=\\G.{100})"); // this would be all 100 chars
// -> ['Theq', 'uick', 'brow', 'nfox', 'jump', 's']
Source : | Last Update : Sat, 11 Sep 21
Question : java split string array
Answered by : bewildered-buzzard-u8gl7vxy0y60
Java example to split a string
String str = "A-B-C-D";
String[] strArray = str.split("-");
System.out.println(Arrays.toString(strArray)); // [A, B, C, D]
Source : https://howtodoinjava.com/java/string/java-string-split-example/ | Last Update : Sun, 12 Dec 21
Question : split string into array java
Answered by : courageous-camel-y4vfpr8cix55
String[] array = values.split("\\|", -1);
Source : https://stackoverflow.com/questions/14414582/java-split-string-to-array | Last Update : Tue, 10 Nov 20
Question : java how to split a string to array
Answered by : inna-kim
String str= "abcdef"; String[] array=str.split("(?<=\\G.{2})"); System.out.println(java.util.Arrays.toString(array));
Source : | Last Update : Mon, 11 Apr 22