effect-io-ai

Package: effect
Module: String

String.startsWith

Returns true if the string starts with the specified search string.

Example (Checking string prefixes)

import { pipe, String } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(pipe("hello world", String.startsWith("hello")), true)
assert.deepStrictEqual(pipe("hello world", String.startsWith("world")), false)

Signature

declare const startsWith: (searchString: string, position?: number) => (self: string) => boolean

Source

Since v2.0.0