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

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

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