Java示例strOrig.lastIndexOf(Stringname)方法 Java示例字符串比较==运算符 Java 示例 strOrig.lastIndexOf(Stringname) 方法 Java示例strOrig.lastIndexOf(Stringname)方法 public class SearchlastString { public static void main(String[] args) { String strOrig = "Hello world ,Hello Reader"; int lastIndex = strOrig.lastIndexOf("Hello"); if(lastIndex == - 1){ System.out.println("Hello not found"); } else { System.out.println("Last occurrence of Hello is at index "+ lastIndex); } } } Java示例字符串比较==运算符 Java 示例 strOrig.lastIndexOf(Stringname) 方法