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

# localizedStandardRange(of:)

Finds and returns the range of the first occurrence of a given string, taking the current locale into account.  Returns nil if the string was not found.

## Declaration

```swift
func localizedStandardRange<T>(of string: T) -> Range<Self.Index>? where T : StringProtocol
```

## Discussion

Discussion This is the most appropriate method for doing user-level string searches, similar to how searches are done generally in the system.  The search is locale-aware, case and diacritic insensitive.  The exact list of search options applied may change over time.
