Skip to main content
Module

x/fun/mod.ts>string.endsWith

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.endsWith
import { string } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { endsWith } = string;

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

Examples

Example 1

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

const withbye = endsWith("bye");

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

Parameters

searchString: string
optional
position: number