CharAt function


charAt String

charAt (String str, Integer n)

Extracts the nth character from the string. String indexes are zero-based, the first character in the string is at 0.

Parameters:

str - String to be examined n - index of character to be extracted

Returns:

The character at position n in the string.

Example

str = "This is an example string"
c1 = charAt(str, 0)
c2 = charAt(str, 12)
// c1 is "T", c2 is "x"

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*