---
title: "localizedStandardRange(of:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsstring/localizedstandardrange(of:)"
---

# localizedStandardRange(of:)

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

## Declaration

```swift
func localizedStandardRange(of str: String) -> NSRange
```

## Parameters

- `str`: The string to search for. This value must not be nil.

## Return Value

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

- [contains(_:)](foundation/nsstring/contains(_:).md)
- [localizedCaseInsensitiveContains(_:)](foundation/nsstring/localizedcaseinsensitivecontains(_:).md)
- [localizedStandardContains(_:)](foundation/nsstring/localizedstandardcontains(_:).md)
- [rangeOfCharacter(from:)](foundation/nsstring/rangeofcharacter(from:).md)
- [rangeOfCharacter(from:options:)](foundation/nsstring/rangeofcharacter(from:options:).md)
- [rangeOfCharacter(from:options:range:)](foundation/nsstring/rangeofcharacter(from:options:range:).md)
- [range(of:)](foundation/nsstring/range(of:).md)
- [range(of:options:)](foundation/nsstring/range(of:options:).md)
- [range(of:options:range:)](foundation/nsstring/range(of:options:range:).md)
- [range(of:options:range:locale:)](foundation/nsstring/range(of:options:range:locale:).md)
- [enumerateLines(_:)](foundation/nsstring/enumeratelines(_:).md)
- [enumerateSubstrings(in:options:using:)](foundation/nsstring/enumeratesubstrings(in:options:using:).md)
