how to check if a string does not contain a substring in java code example
Example 1: string contains specific word in java
str_Sample.contains("Example"));
Example 2: string contains specific word in java
public boolean String.contains(CharSequence s);
Example 3: string check if substring exists java
String str1 = "Java";
String str2 = "va";
if(str1.contains(str2)){
// str1.contains(str2) will be true here.
System.out.println("I am true");
}