Answers for "java get char from char index"

13

character at index of string java

String str = "Grepper";
char ch = str.charAt(0);
//ch is assigned the value of G
Posted by: Guest on June-03-2020
0

find char in string java

String str = "testdemo";
      System.out.println("String: "+str);
      int index = str.indexOf( 'h' );
      System.out.printf("'h' is at index %d\n", index);
Posted by: Guest on August-15-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language