<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFStringFindWithOptionsAndLocale(_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFStringFindWithOptionsAndLocale"
  },
  "title" : "CFStringFindWithOptionsAndLocale(_:_:_:_:_:_:)"
}
-->

# CFStringFindWithOptionsAndLocale(_:_:_:_:_:_:)

Returns a Boolean value that indicates whether a given string was found in a given source string.

```
func CFStringFindWithOptionsAndLocale(_ theString: CFString!, _ stringToFind: CFString!, _ rangeToSearch: CFRange, _ searchOptions: CFStringCompareFlags, _ locale: CFLocale!, _ result: UnsafeMutablePointer<CFRange>!) -> Bool
```

## Parameters

`theString`

The string in which to to search for `stringToFind`.

`stringToFind`

The substring to search for in `theString`.

`rangeToSearch`

A range of the characters to search in `theString`. The specified range must not exceed the length of the string.

`searchOptions`

The option flags to control the search behavior. See [String Comparison Flags](/documentation/CoreFoundation/string-comparison-flags) for possible values. The flags [`compareNumerically`](/documentation/CoreFoundation/CFStringCompareFlags/compareNumerically) and [`compareForcedOrdering`](/documentation/CoreFoundation/CFStringCompareFlags/compareForcedOrdering) are ignored.

`locale`

The locale to use for the search comparison. `NULL` specifies the canonical locale (the return value from [`CFLocaleGetSystem()`](/documentation/CoreFoundation/CFLocaleGetSystem())).

    The locale argument affects the equality checking algorithm. For example, for the Turkish locale, case-insensitive compare matches “I” to “ı” (Unicode code point U+0131, Latin Small Dotless I), not the normal “i” character.

`result`

On return, if the function result is `true` contains the starting location and length of the found substring. You may pass `NULL` if you only want to know if the `theString` contains `stringToFind`.

## Return Value

`true` if the substring was found, `false` otherwise.

## Discussion

If `stringToFind` is the empty string (zero length), nothing is found.

---

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)