@wtasnorg/node-lib / indexString
indexString(
s,substr):number
Defined in: src/strings.ts:481
Index returns the index of the first instance of substr in s, or -1 if substr is not present in s.
string
Input string.
string
Substring to find.
number
Index of first occurrence, or -1.
index("chicken", "ken"); // 4
index("chicken", "dmr"); // -1
index("foo", "foobar"); // -1 — substr longer than s
index("", ""); // 0