Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 490 Bytes

File metadata and controls

33 lines (24 loc) · 490 Bytes

Skip:

It ignores the first n elements of a stream and processes the remaining elements.

List<Integer> numbers = List.of(1, 2, 3, 4, 5);

List<Integer> result = numbers.stream()
        .skip(2)
        .toList();

System.out.println(result);

Output:

[3, 4, 5]

Previous: G Limit

Next: I Take While