Instance Method

localizedStandardRange(of:)

Finds and returns the range of the first occurrence of a given string within the receiver by performing a case and diacritic insensitive, locale-aware search.

Declaration

func localizedStandardRange(of str: String) -> NSRange

Parameters

str

The string to search for. This value must not be nil.

Return Value

The range of the first occurrence of str in the receiver. Returns {NSNotFound, 0} if str is not found.

See Also

Finding Characters and Substrings

func contains(String)

Returns whether the receiver contains a given string by performing a case-sensitive, locale-unaware search.

func localizedCaseInsensitiveContains(String)

Returns whether the receiver contains a given string by performing a case-insensitive, locale-aware search.

func localizedStandardContains(String)

Returns whether the receiver contains a given string by performing a case and diacritic insensitive, locale-aware search.

func rangeOfCharacter(from: CharacterSet)

Finds and returns the range in the receiver of the first character from a given character set.

func rangeOfCharacter(from: CharacterSet, options: NSString.CompareOptions = [])

Finds and returns the range in the receiver of the first character, using given options, from a given character set.

func rangeOfCharacter(from: CharacterSet, options: NSString.CompareOptions = [], range: NSRange)

Finds and returns the range in the receiver of the first character from a given character set found in a given range with given options.

func range(of: String)

Finds and returns the range of the first occurrence of a given string within the receiver.

func range(of: String, options: NSString.CompareOptions = [])

Finds and returns the range of the first occurrence of a given string within the receiver, subject to given options.

func range(of: String, options: NSString.CompareOptions = [], range: NSRange)

Finds and returns the range of the first occurrence of a given string, within the given range of the receiver, subject to given options.

func range(of: String, options: NSString.CompareOptions = [], range: NSRange, locale: Locale?)

Finds and returns the range of the first occurrence of a given string within a given range of the receiver, subject to given options, using the specified locale, if any.