Created
June 11, 2019 19:44
-
-
Save JO3-W3B-D3V/c26edcc98f56cd661a648cb990c25dad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A functional example | |
return someList.stream() | |
.map(String::toLowerCase) | |
.anyMatch(x::contains); | |
// A more traditional example | |
for (String str : someList) { | |
if (x.contains(str.toLowerCase())){ | |
return true; | |
} | |
} | |
return false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment