Splitting a string into n-length chunks in Java
You can do this with Guava's Splitter:
Splitter.fixedLength(chunkSize).split(s)
...which returns an Iterable<String>
.
Some more examples in this answer.
You can do this with Guava's Splitter:
Splitter.fixedLength(chunkSize).split(s)
...which returns an Iterable<String>
.
Some more examples in this answer.