(searchString: string, position?: number): (self: string) => booleanReturns 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 const includes: (
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)
includes = (searchString: stringsearchString: string, position: number | undefinedposition?: number) => (self: stringself: string): boolean =>
self: stringself.String.includes(searchString: string, position?: number): booleanReturns true if searchString appears as a substring of the result of converting this
object to a String, at one or more positions that are
greater than or equal to position; otherwise, returns false.
includes(searchString: stringsearchString, position: number | undefinedposition)