Subscript

subscript(_:)

Accesses the text in the given range.

Declaration

subscript(bounds: Range<String.Index>) -> String { get }

Discussion

Complexity: O(n) if the underlying string is bridged from Objective-C, where n is the length of the string; otherwise, O(1).