<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 9.0.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/StringProtocol/localizedStandardContains(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:Sy10FoundationE25localizedStandardContainsySbqd__SyRd__lF"
  },
  "title" : "localizedStandardContains(_:)"
}
-->

# localizedStandardContains(_:)

Returns a Boolean value indicating whether the string contains the given
string, taking the current locale into account.

```
func localizedStandardContains<T>(_ string: T) -> Bool where T : StringProtocol
```

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)