Hyperlinkv0.8.0-beta.28

String

String.startsWithconsteffect/String.ts:500
(searchString: string, position?: number): (self: string) => boolean

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)
predicates
Source effect/String.ts:5002 lines
export const startsWith = (searchString: string, position?: number) => (self: string): boolean =>
  self.startsWith(searchString, position)