contains() in string in java code example
Example 1: string contains specific word in java
str_Sample.contains("Example"));
Example 2: contains example in java
String s1 = "My name is GFG";
// prints true
System.out.println(s1.contains("GFG"));
// prints false
System.out.println(s1.contains("geeks"));