String s = "I have an orange";
if (s.indexOf("orange") != -1){
System.out.println("orange found");
}
String s = "Java is great";
if (s.contains("Java"))
System.out.println("Java is found");
String s = "I have an orange";
if (s.indexOf("orange") != -1){
System.out.println("orange found");
}
String s = "Java is great";
if (s.contains("Java"))
System.out.println("Java is found");