So finden Sie ein Wort in String in Java
String s = "I have an orange";
if (s.indexOf("orange") != -1){
System.out.println("orange found");
}
Innocent Iguana
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");