Hyperlinkv0.8.0-beta.28

String

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

Returns true if searchString appears as a substring of self, at one or more positions that are greater than or equal to position; otherwise, returns false.

Example (Checking for substrings)

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

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