string to search for needles in
characters to search for in haystack
specifies whether comparisons are case-sensitive (Yes.caseSensitive) or not (No.caseSensitive)
The index of the first occurrence of any of the elements of needles in haystack. If no element of needles is found or startIdx is greater than or equal to haystack.length, then -1 is returned. If the parameters are not valid UTF, the result will still be either -1 or in the range [startIdx .. haystack.length], but will not be reliable otherwise.
If the sequence starting at startIdx does not represent a well-formed code point, then a std.utf.UTFException may be thrown.
import std.conv : to; ptrdiff_t i = "helloWorld".indexOfAny("Wr"); assert(i == 5); i = "öällo world".indexOfAny("lo "); assert(i == 4, to!string(i));
import std.conv : to; ptrdiff_t i = "helloWorld".indexOfAny("Wr", 4); assert(i == 5); i = "Foo öällo world".indexOfAny("lh", 3); assert(i == 8, to!string(i));
Searches the string haystack for one of the characters in needles starting at index startIdx. If startIdx is not given, it defaults to 0.