2 ms·
I was a bit disappointed at the string api in swift4 recently. They removed the need to access characters every time, but they kept the Index type, which adds a
by bsaul 9y ago
I was a bit disappointed at the string api in swift4 recently. They removed the need to access characters every time, but they kept the Index type, which adds an intermediate step every time you want to build a range, without providing any more safety than just using integers: it still crashes on index out of bounds, so you still need to manually bound check, only you have to compare to startIndex and endIndex.
I still don’t get the benefit..