@wtasnorg/node-lib / cutString
cutString(
s,sep):object
Defined in: src/strings.ts:264
Cut slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s.
string
Input string.
string
Separator string.
object
after:
string
before:
string
found:
boolean
cut("Gopher@example.com", "@"); // { before: "Gopher", after: "example.com", found: true }
cut("Gopher", "@"); // { before: "Gopher", after: "", found: false }
cut("ab", "abc"); // { before: "ab", after: "", found: false } — sep longer than s