<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextFinderClient/string(at:effectiveRange:endsWithSearchBoundary:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextFinderClient(im)stringAtIndex:effectiveRange:endsWithSearchBoundary:"
  },
  "title" : "string(at:effectiveRange:endsWithSearchBoundary:)"
}
-->

# string(at:effectiveRange:endsWithSearchBoundary:)

Returns the found string that is created by conceptually mapping its content to a single string, which is composed of a concatenation of all its substrings.

```
optional func string(at characterIndex: Int, effectiveRange outRange: NSRangePointer, endsWithSearchBoundary outFlag: UnsafeMutablePointer<ObjCBool>) -> String
```

## Parameters

`characterIndex`

The given character index the client should return.

`outRange`

Returns, by reference, the “effective range” of that substring in the full conceptually concatenated string

`outFlag`

Returns, by-reference, whether the substring ends with a “search boundary”, meaning that NSTextFinder should not attempt to find any matches that overlap this boundary.

## Return Value

Returns the found string.

## Discussion

See [`NSTextFinder`](/documentation/AppKit/NSTextFinder) for more information.

---

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)