Hyperlinkv0.8.0-beta.28

String

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

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

Example (Checking string suffixes)

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

assert.deepStrictEqual(pipe("hello world", String.endsWith("world")), true)
assert.deepStrictEqual(pipe("hello world", String.endsWith("hello")), false)
predicates
Source effect/String.ts:5192 lines
export const endsWith = (searchString: string, position?: number) => (self: string): boolean =>
  self.endsWith(searchString, position)