Shorthand for Offsetting startIndex and endIndex

String is an important exception, because Unicode makes things complicated.

  • String.subscript(i: Index) is not guaranteed to be a constant-time operation, because it sometimes needs to find the end of a grapheme cluster.
  • Similarly, String.first/String.last are examples of O(n) properties.