Finds and returns the range of the first occurrence of a given string within the receiver.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
The string to search for.
NSRange structure giving the location and length in the receiver of the first occurrence of
, 0} if
is not found or is empty (
range(of: with no options.
NSString objects are compared by checking the Unicode canonical equivalence of their code point sequences. The length of the returned range and that of
may differ if equivalent composed character sequences are matched.