---
title: "lineRange(for:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/stringprotocol/linerange(for:)"
---

# lineRange(for:)

Returns the range of characters representing the line or lines containing a given range.

## Declaration

```swift
func lineRange(for range: some RangeExpression<String.Index>) -> Range<Self.Index>
```
