Java split list according to the integer n

Viewed 31

Is there anyway in Java to split a string into a list n characters at the time? Pseudo-code example:

n = 2;
String s = "ABCDEFGH"
list = ["AB", "CD", "EF", "GH"] // because n = 2
0 Answers
Related