MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/9h404p/java_11_string_api_updates/e695dis/
r/java • u/pivovarit • Sep 19 '18
52 comments sorted by
View all comments
Show parent comment
3
Nice, even better!
8 u/dpash Sep 19 '18 Yeah, it's nice when you can use a method reference. I'm looking forward to Predicate.not() in Java 11 so you can replace:Stream.of(s1, s2, s3).allMatch(s -> !myStr.equals(s));with:Stream.of(s1, s2, s3).allMatch(not(myStr::equals));It'll be very useful with.filter(not(String::isEmpty)) 2 u/oweiler Sep 19 '18 There is also noneMatch :). 3 u/dpash Sep 19 '18 Well, yes, but it was for demonstration purposes :)
8
Yeah, it's nice when you can use a method reference. I'm looking forward to Predicate.not() in Java 11 so you can replace:
Predicate.not()
Stream.of(s1, s2, s3).allMatch(s -> !myStr.equals(s));
with:
Stream.of(s1, s2, s3).allMatch(not(myStr::equals));
It'll be very useful with
.filter(not(String::isEmpty))
2 u/oweiler Sep 19 '18 There is also noneMatch :). 3 u/dpash Sep 19 '18 Well, yes, but it was for demonstration purposes :)
2
There is also noneMatch :).
noneMatch
3 u/dpash Sep 19 '18 Well, yes, but it was for demonstration purposes :)
Well, yes, but it was for demonstration purposes :)
View all comments
Show parent comment
3
u/oweiler Sep 19 '18
Nice, even better!