Finds and returns the range in the string of the first character from a given character set found in a given range with given options.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
A character set. This value must not be
The range in which to search.
amust not exceed the bounds of the receiver.
The range in the receiver of the first character found from
a. Returns a range of
, 0} if none of the characters in
a are found.
This method does not perform any Unicode normalization on the receiver, so canonically equivalent forms will not be matched. For example, searching the string “strüdel”—containing the decomposed characters “
U+0075 LATIN SMALL LETTER U) and “
U+0308 COMBINING DIAERESIS)—with a character set containing the precomposed character “
U+00FC LATIN SMALL LETTER U WITH DIAERESIS) would return the range
, 0}, because none of the characters in the set are found.