Counts the number of times a given substring occurs in a string.
StringCount(s, x[, f[, δ]])
sis the string to be searched
xis the substring to search for
fis a string
δis a positive integer
x are strings, then
StringCount returns the number of times
x occurs in
s, subject to any additional restrictions imposed by the remaining arguments.
f specifies flags for the algorithm. It is a string that can contain zero or more of the following characters:
xin a case-insensitive manner.
xto be a substring of
xis found as a full word in
f defaults to
"" (no options).
δ is specified,
StringCount will begin searching
x at character index
s (the first character having index 1).
Alice ≔ ExampleData("Alice in Wonderland");
'("rabbit", "beautiful", "extraordinary", "mirror") @ (word ↦ StringCount(Alice, word, "i"))
52 15 2 0