java string char at index code example
Example 1: character at index of string java
String str = "Grepper";
char ch = str.charAt(0);
//ch is assigned the value of G
Example 2: string char at java
char ch=name.charAt(4);
String str = "Grepper";
char ch = str.charAt(0);
//ch is assigned the value of G
char ch=name.charAt(4);