Skip to content

Instantly share code, notes, and snippets.

@mcupak
Created November 7, 2017 22:10
Show Gist options
  • Select an option

  • Save mcupak/15bf5755ac4fbb1755b42cad9e228b6a to your computer and use it in GitHub Desktop.

Select an option

Save mcupak/15bf5755ac4fbb1755b42cad9e228b6a to your computer and use it in GitHub Desktop.
jshell> IntStream.range(0,10).takeWhile(x -> x < 5).forEach(System.out::println)
0
1
2
3
4
jshell> IntStream.range(0,10).dropWhile(x -> x < 5).forEach(System.out::println)
5
6
7
8
9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment