(searchString: string, position?: number): (self: string) => booleanReturns 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 const endsWith: (
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)
endsWith = (searchString: stringsearchString: string, position: number | undefinedposition?: number) => (self: stringself: string): boolean =>
self: stringself.String.endsWith(searchString: string, endPosition?: number): booleanReturns true if the sequence of elements of searchString converted to a String is the
same as the corresponding elements of this object (converted to a String) starting at
endPosition – length(this). Otherwise returns false.
endsWith(searchString: stringsearchString, position: number | undefinedposition)