at()

Get the character located at the given index.

Signature

at(index: Int): Value

Description

The at() method returns the UTF-16 character located at offset index, which is a zero-based offset that must be less than the String length.

Parameters

Parameter Type Required Description

index

Int

Yes

Zero-based offset in the String of the character to return. Must be less than the string length.

Return value

Type Description

String

Character located at index.

Examples

Return the character at index offset 9:

"HTTP/1.1 200 OK".at(9)
"2"

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!