Skip to main content
Module

x/fun/string.ts>startsWith

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function startsWith
import { startsWith } from "https://deno.land/x/fun@v2.0.0/string.ts";

Creates a Predicate over string that returns true when the string starts with the supplied searchString starting at position, if it is supplied.

Examples

Example 1

import { startsWith } from "./string.ts";

const withHello = startsWith("Hello");

const result1 = withHello("Hello World"); // true
const result2 = withHello("Goodbye"); // false

Type Parameters

T extends string

Parameters

searchString: T
optional
position: number