Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fun/mod.ts>string.startsWith

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

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

Parameters

searchString: string
optional
position: number