java_函数手册_String_1.8_contains_判断是否包含指定字符串
1 package calssString; 2 3 public class contains___1_8 { 4 public static void main(String[] args) { 5 String strCom = "I LIKE JAVA"; 6 boolean str = strCom.contains("JAVA"); 7 System.out.println(str); 8 9 strCom = "I LIKE JAVA"; 10 str = strCom.contains("J AVA"); 11 System.out.println(str); 12 13 } 14 }