@wtasnorg/node-lib / cutPrefixString
cutPrefixString(
s,prefix):object
Defined in: src/strings.ts:284
CutPrefix returns s without the provided leading prefix string and reports whether it found the prefix.
string
Input string.
string
Prefix to remove.
object
after:
string
found:
boolean
cutPrefix("Gopher", "Go"); // { after: "pher", found: true }
cutPrefix("Gopher", "X"); // { after: "Gopher", found: false }
cutPrefix("ab", "abc"); // { after: "ab", found: false } — prefix longer than s