Skip to content

Instantly share code, notes, and snippets.

@JO3-W3B-D3V
Created June 11, 2019 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JO3-W3B-D3V/c26edcc98f56cd661a648cb990c25dad to your computer and use it in GitHub Desktop.
Save JO3-W3B-D3V/c26edcc98f56cd661a648cb990c25dad to your computer and use it in GitHub Desktop.
// 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