<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSString/getParagraphStart(_:end:contentsEnd:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSString(im)getParagraphStart:end:contentsEnd:forRange:"
  },
  "title" : "getParagraphStart(_:end:contentsEnd:for:)"
}
-->

# getParagraphStart(_:end:contentsEnd:for:)

Returns by reference the beginning of the first paragraph and the end of the last paragraph touched by the given range.

```
func getParagraphStart(_ startPtr: UnsafeMutablePointer<Int>?, end parEndPtr: UnsafeMutablePointer<Int>?, contentsEnd contentsEndPtr: UnsafeMutablePointer<Int>?, for range: NSRange)
```

## Parameters

`startPtr`

Upon return, contains the index of the first character of the paragraph containing the beginning of `aRange`. Pass `NULL` if you do not need this value (in which case the work to compute the value isn’t performed).

`parEndPtr`

Upon return, contains the index of the first character past the terminator of the paragraph containing the end of `aRange`. Pass `NULL` if you do not need this value (in which case the work to compute the value isn’t performed).

`contentsEndPtr`

Upon return, contains the index of the first character of the terminator of the paragraph containing the end of `aRange`. Pass `NULL` if you do not need this value (in which case the work to compute the value isn’t performed).

`range`

A range within the receiver. The value must not exceed the bounds of the receiver.

## Discussion

A paragraph is any segment of text delimited by a carriage return (`U+000D`), newline (`U+000A`), or paragraph separator (`U+2029`).

If `aRange` is contained with a single paragraph, of course, the returned indexes all belong to that paragraph. Similar to [`getLineStart(_:end:contentsEnd:for:)`](/documentation/Foundation/NSString/getLineStart(_:end:contentsEnd:for:)), you can use the results of this method to construct the ranges for paragraphs.

---

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)