Java示例在字符串中搜索 Java示例从命令行反向字符串 Java示例在String对象中搜索 Java示例在字符串中搜索 public class SearchStringEmp{ public static void main(String[] args) { String strOrig = "Hello readers"; int intIndex = strOrig.indexOf("Hello"); if(intIndex == - 1) { System.out.println("Hello not found"); } else { System.out.println("Found Hello at index " + intIndex); } } } Java示例从命令行反向字符串 Java示例在String对象中搜索