(index: number): (self: string) => Option.Option<string>
(self: string, index: number): Option.Option<string>Returns the character at the specified relative index safely, or None if the index is out of bounds.
Example (Accessing characters safely)
import { pipe, String } from "effect"
pipe("abc", String.at(1)) // Option.some("b")
pipe("abc", String.at(4)) // Option.none()elements
Source effect/String.ts:5784 lines
export const const at: {
(index: number): (
self: string
) => Option.Option<string>
(
self: string,
index: number
): Option.Option<string>
}
Returns the character at the specified relative index safely, or None if the index is out of bounds.
Example (Accessing characters safely)
import { pipe, String } from "effect"
pipe("abc", String.at(1)) // Option.some("b")
pipe("abc", String.at(4)) // Option.none()
at: {
(index: numberindex: number): (self: stringself: string) => import OptionOption.type Option.Option = /*unresolved*/ anyOption<string>
(self: stringself: string, index: numberindex: number): import OptionOption.type Option.Option = /*unresolved*/ anyOption<string>
} = import dualdual(2, (self: stringself: string, index: numberindex: number): import OptionOption.type Option.Option = /*unresolved*/ anyOption<string> => import OptionOption.fromUndefinedOr(self: stringself.String.at(index: number): string | undefinedReturns a new String consisting of the single UTF-16 code unit located at the specified index.
at(index: numberindex)))