How would I split a string into equal parts using String.split()
provided the string is full of numbers? For the sake of example, each part in the below is of size 5.
"123" would be split into "123"
"12345" would be split into "12345"
"123451" would be split into "12345" and "1"
"123451234512345" would be split into "12345", "12345" and "12345"
etc
These are to be put in an array:
String myString = "12345678";
String[] myStringArray = myString.split(???);
//myStringArray => "12345", "678";
I'm just unsure the regex to use, nor how to separate it into equal sized chunks.