Java - Write code to check if a string contains Any other string in an array using Stream


Write code to contains Any


//package com.book2s;
import java.util.Arrays;

public class Main {
  public static void main(String[] argv) {
    String str = "";
    String searchStrings = "o";
    System.out.println(containsAny(str, searchStrings));
  }//w  w  w. j  a v a2  s . c om

  public static boolean containsAny(final String str, final String... searchStrings) {
    return -> str.contains(s));