Skip to content

Instantly share code, notes, and snippets.

@knjname
Last active December 17, 2015 00:49
Show Gist options
  • Select an option

  • Save knjname/5523561 to your computer and use it in GitHub Desktop.

Select an option

Save knjname/5523561 to your computer and use it in GitHub Desktop.
import java.util.Arrays;
import java.util.stream.Stream;
public class StreamExample {
public static void main(String... args){
Stream.of("1", "Foo", "2", "Bar", "3")
.filter(
str -> {
// To view stacktrace.
new Exception().printStackTrace();
return str.matches("\\d");
}
)
.forEach(System.out::println);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment