Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/string/index.ts>stripStart

A JavaScript extension package for building strong and modern applications.
Latest
function stripStart
import { stripStart } from "https://deno.land/x/ayonli_jsext@v0.9.72/string/index.ts";

Removes the given prefix of the string if present.

Examples

Example 1

import { stripStart } from "@ayonli/jsext/string";

console.log(stripStart("hello world", "hello")); // " world"
console.log(stripStart("hello world", "hi")); // "hello world"

Parameters

str: string
prefix: string

Returns

string