@anio-js-foundation/strip-prefix
v1.0.0
Published
Remove the prefix of a string.
Downloads
3
Readme
@anio-js-foundation/strip-prefix
Remove the prefix of a string.
Throws error if string doesn't start with prefix:
import stripPrefix from "@anio-js-foundation/strip-prefix"
console.log(stripPrefix("Hello, World", "Hello, ")) // "World"
console.log(stripPrefix("Hello, World", "Test")) // Error