(index: number): (self: string) => Option.Option<number>
(self: string, index: number): Option.Option<number>Returns the character code at the specified index safely, or None if the index is out of bounds.
Example (Reading character codes)
import { String } from "effect"
String.charCodeAt("abc", 1) // Option.some(98)
String.charCodeAt("abc", 4) // Option.none()elements
Source effect/String.ts:5378 lines
export const const charCodeAt: {
(index: number): (
self: string
) => Option.Option<number>
(
self: string,
index: number
): Option.Option<number>
}
Returns the character code at the specified index safely, or None if the index is out of bounds.
Example (Reading character codes)
import { String } from "effect"
String.charCodeAt("abc", 1) // Option.some(98)
String.charCodeAt("abc", 4) // Option.none()
charCodeAt: {
(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.filter(import OptionOption.some(self: stringself.String.charCodeAt(index: number): numberReturns the Unicode value of the character at the specified location.
charCodeAt(index: numberindex)), (charCode: anycharCode) => !function isNaN(number: number): booleanReturns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
isNaN(charCode: anycharCode))
)