Package: effect
Module: String
Returns the character at the specified non-negative index safely, or None if the index is out of bounds.
Example (Reading characters safely)
import { pipe, String } from "effect"
pipe("abc", String.charAt(1)) // Option.some("b")
pipe("abc", String.charAt(4)) // Option.none()
Signature
declare const charAt: { (index: number): (self: string) => Option.Option<string>; (self: string, index: number): Option.Option<string>; }
Since v2.0.0