Returns the character at the specified position in the string.

Syntax

<expC>.charAt(<expN>)

<expC>

A string.

<expN>

Index into the string, which is indexed from left to right. The first character of the string is at index 0 and the last character is at index <expC>.length – 1.

Property of

String

Description

charAt( ) returns the character in a String object at the specified index position. If the index position is after the last character in the string, charAt( ) returns an empty string.