Returns a list with the positions of all occurrences of a given substring in a string.
StringIndices(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
StringIndices returns the list with the positions of all occurrences of
s, subject to any additional restrictions imposed by the remaining arguments. The list is sorted.
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,
StringIndices will begin searching
x at character index
s (the first character having index 1).
Alice ≔ ExampleData("Alice in Wonderland");
StringIndices(Alice, "rabbit", "i") \ 10
118 696 850 1069 1260 1455 1605 5390 5675 13749 ⋮