import java.util.*;
import static io.javadash.CollectionUtils.chunk;
public class Main {
public static void main(String[] args) {
List<String> input = Arrays.asList("a", "b", "c", "d");
int size = 2;
List<List<String>> result = chunk(input, size);
System.out.println(result);
}
}
JavaDash is released under the MIT license & supports modern environments.
JavaDash is released on the Maven Central Repository
Use Maven:
<dependency>
<groupId>io.github.bypaycorporation</groupId>
<artifactId>javadash</artifactId>
<version>1.0.2</version>
</dependency>
Use Gradle:
implementation 'io.github.bypaycorporation:javadash:1.0.2'
JavaDash makes Java easier by taking the hassle out of working with collections, maths, langs, dates, strings, etc. JavaDash’s modular methods are great for:
Tested in Java 8+.