Instance Method

lineRange(for:)

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

Declaration

func lineRange(for range: NSRange) -> NSRange

Parameters

aRange

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

Return Value

The range of characters representing the line or lines containing aRange, including the line termination characters. See getLineStart(_:end:contentsEnd:for:) for a discussion of line terminators.

See Also

Related Symbols

func paragraphRange(for: NSRange)

Returns the range of characters representing the paragraph or paragraphs containing a given range.

func substring(with: NSRange)

Returns a string object containing the characters of the receiver that lie within a given range.

func getLineStart(UnsafeMutablePointer<Int>?, end: UnsafeMutablePointer<Int>?, contentsEnd: UnsafeMutablePointer<Int>?, for: NSRange)

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