What is charAt() in JavaScript?
The charAt() method in Java returns a string character from a specified index.
Syntax
The syntax of this method is as follows:
string.charAt(index)
Parameters
The charAt() function takes one integer parameter that is the index from which the character needs to be extracted.
Return value
The return value is a character from the specified index.
Code
In the code below, the character E is extracted from the string s with the help of the charAt() method.
// extacting the character from 11th index of the stringclass string {public static void main( String args[] ) {String s = "Welcome to Educative";char ch = s.charAt(11);System.out.println(ch);}}