Break a string up into substrings all of variable length

suggest change

Same as the known length example, but insert the length into regex:

int length = 5;
String[] parts = str.split("(?<=\\G.{" + length + "})");

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents