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

x/ayonli_jsext/esm/string/index.js>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/esm/string/index.js";

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
prefix