paragraphRange(for:)

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

Declaration

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