Table of Contents

charAt

charAt(int index)

description of charAt

returns char value at the specified index of string.

example of charAt in java

package lang;
 
public class Lang {
 
    public static void main(String[] args) {
 
        String str = "test 1234";
        char chr;
 
        chr = str.charAt(1);
 
        System.out.println(chr+" is the 2 char");
    }
}

output of charAt

 e is the 2 char