# Why are String offsets so complicated?

**URL:** <https://forums.swift.org/t/why-are-string-offsets-so-complicated/19753>\
**Category:** Using Swift\
**Created:** [January 24, 2019, 8:24am UTC](https://forums.swift.org/t/why-are-string-offsets-so-complicated/19753 "2019-01-24T08:24:27Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![nick.keets](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nick.keets/32/2023_2.png) [@nick.keets](https://forums.swift.org/u/nick.keets)\
**Post date:** [January 24, 2019, 12:32pm UTC](https://forums.swift.org/t/why-are-string-offsets-so-complicated/19753/13 "2019-01-24T12:32:08Z")

</div>

This comes up about once every 6 months. Here are some previous discussions:

> [@Shorthand for Offsetting startIndex and endIndex](https://forums.swift.org/t/shorthand-for-offsetting-startindex-and-endindex/9397):
>
> Hello, Swift-Evolution Using collection indexes are a bit of a bother when you want to do simple slicing and a type is not indexed by Int. For a simple example take the code here: let s = "Hello, Swift" let m = s[...s.index(s.startIndex, offsetBy: 4)] The intent of advancing startIndex gets a bit muddled. So to ease this I think we could add startIndex(offsetBy:) and endIndex(offsetBy:) to Collection . Making the example above: let s = "Hello, Swift" let m = s[...s.startIndex(offsetBy: 4)…

> [@String slicing ergonomics](https://forums.swift.org/t/string-slicing-ergonomics/14398):
>
> I simply want to reopen the discussion about why this: string[string.startIndex..\<string.index(string.startIndex, offsetBy: 15)] Cannot be simply this: string[0..\<15] Or even better: string[..\<15] After years of using Swift I continue to have to search how to slice a string each time. It's extremely cumbersome and user-hostile.

---

_[View the full topic](https://forums.swift.org/t/why-are-string-offsets-so-complicated/19753)._
