java_函数手册_String_1.5_compareToIgnoreCase_忽略大小写比较两个字符串
1 package calssString; 2 3 public class compareToIgnoreCase___1_6 { 4 public static void main(String[] args) { 5 String comStr = "I LIKE JAVA"; 6 String comStr1 = "I LIKE PHP"; 7 int strLower = comStr.compareToIgnoreCase(comStr1); 8 System.out.println(strLower); 9 10 comStr = "I LIKE JAVA"; 11 comStr1 = "i like PHP"; 12 strLower = comStr.compareToIgnoreCase(comStr1); 13 System.out.println(strLower); 14 } 15 }