@wtasnorg/node-lib / cutSuffixString
cutSuffixString(
s,suffix):object
Defined in: src/strings.ts:303
CutSuffix returns s without the provided ending suffix string and reports whether it found the suffix.
string
Input string.
string
Suffix to remove.
object
before:
string
found:
boolean
cutSuffix("Gopher", "er"); // { before: "Goph", found: true }
cutSuffix("Gopher", "X"); // { before: "Gopher", found: false }
cutSuffix("ab", "abc"); // { before: "ab", found: false } — suffix longer than s