# Call for Users (and Authors): Offset indexing pitch

**URL:** <https://forums.swift.org/t/call-for-users-and-authors-offset-indexing-pitch/21444>\
**Category:** Pitches\
**Created:** [March 10, 2019, 9:46pm UTC](https://forums.swift.org/t/call-for-users-and-authors-offset-indexing-pitch/21444 "2019-03-10T21:46:43Z")\
**Posts on this page:** 1\
**Showing post:** 51

<div class="post-metadata">

**Author:** ![Joe\_Groff](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/joe_groff/32/1929_2.png) [@Joe\_Groff](https://forums.swift.org/u/Joe_Groff)\
**Post date:** [March 12, 2019, 9:04pm UTC](https://forums.swift.org/t/call-for-users-and-authors-offset-indexing-pitch/21444/51 "2019-03-12T21:04:53Z")

</div>

When talking about manipulating strings, it doesn't hurt to look at Perl, one of the great string-manipulating languages. Although Perl promotes its deeply-integrated regexes as the primary string manipulation mechanism, it also provides a free function to do indexed slicing of strings, `substr($x, offset, length)`. Although it isn't O(1) and doesn't use subscript syntax or otherwise feel "first class", that hasn't been a huge deal. Javascript similarly has `substr[ing]` methods on its string type. Maybe we could take the same tack in Swift; spelling the offset-based accessor as `.substr(x, y)` instead of as a subscript would let us offer the easy thing for the times you really need it, while still signaling that, since this isn't a subscript, it isn't intended to be the primary primitive way you decompose strings.

---

_[View the full topic](https://forums.swift.org/t/call-for-users-and-authors-offset-indexing-pitch/21444)._
