Skip to content

Instantly share code, notes, and snippets.

@hdi10
Last active February 7, 2022 02:53
Show Gist options
  • Save hdi10/ddd69b28bddcf77c761b8cdab3f9397f to your computer and use it in GitHub Desktop.
Save hdi10/ddd69b28bddcf77c761b8cdab3f9397f to your computer and use it in GitHub Desktop.
howToStream
List<String> myList =
Arrays.asList("a1","a2","b1","b2","x");
myList
.stream()
.filter(s -> s.startsWith("b"))
.map(String::toUpperCase)
.sorted()
.forEach(System.out::printl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment