<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextFinderClient/string",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextFinderClient(py)string"
  },
  "title" : "string"
}
-->

# string

Allows the client to specify a single string for searching.

```
optional var string: String { get }
```

## Discussion

If the client cannot logically or efficiently flatten itself into a single string, then the [`string(at:effectiveRange:endsWithSearchBoundary:)`](/documentation/AppKit/NSTextFinderClient/string(at:effectiveRange:endsWithSearchBoundary:)) and [`stringLength()`](/documentation/AppKit/NSTextFinderClient/stringLength()) methods should be implemented instead.

---

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)