(index: number): (self: string) => Option.Option<number>
(self: string, index: number): Option.Option<number>Returns the Unicode code point at the specified index safely, or None if the index is out of bounds.
Example (Reading code points)
import { pipe, String } from "effect"
pipe("abc", String.codePointAt(1)) // Option.some(98)
pipe("abc", String.codePointAt(10)) // Option.none()elements
Source effect/String.ts:6214 lines
export const const codePointAt: {
(index: number): (
self: string
) => Option.Option<number>
(
self: string,
index: number
): Option.Option<number>
}
Returns the Unicode code point at the specified index safely, or None if the index is out of bounds.
Example (Reading code points)
import { pipe, String } from "effect"
pipe("abc", String.codePointAt(1)) // Option.some(98)
pipe("abc", String.codePointAt(10)) // Option.none()
codePointAt: {
(index: numberindex: number): (self: stringself: string) => import OptionOption.type Option.Option = /*unresolved*/ anyOption<number>
(self: stringself: string, index: numberindex: number): import OptionOption.type Option.Option = /*unresolved*/ anyOption<number>
} = import dualdual(2, (self: stringself: string, index: numberindex: number): import OptionOption.type Option.Option = /*unresolved*/ anyOption<number> => import OptionOption.fromUndefinedOr(self: stringself.String.codePointAt(pos: number): number | undefinedReturns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
value of the UTF-16 encoded code point starting at the string element at position pos in
the String resulting from converting this object to a String.
If there is no element at that position, the result is undefined.
If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
codePointAt(index: numberindex)))