range(of:options:range:locale:)
Finds and returns the range of the first occurrence of a given string within a given range of the String, subject to given options, using the specified locale, if any.
Declaration
func range<T>(of aString: T, options mask: String.CompareOptions = [], range searchRange: Range<Self.Index>? = nil, locale: Locale? = nil) -> Range<Self.Index>? where T : StringProtocol