The java.lang.String.contains() method returns true if and only if this string contains the specified sequence of char values.
public class Sample { public static void main(String args[]){ String str = "Hello how are you welcome to tutorialspoint"; String test = "tutorialspoint"; Boolean bool = str.contains(test); System.out.println(bool); } }
true