📜  java 在字符串中查找字符 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:46.802000             🧑  作者: Mango

代码示例2
String str = "testdemo";
      System.out.println("String: "+str);
      int index = str.indexOf( 'h' );
      System.out.printf("'h' is at index %d\n", index);