Strings are not arrays – Swift Strings, part 2

preview_player
Показать описание
In this video I outline why Swift’s strings behave differently from its arrays.

Рекомендации по теме
Комментарии
Автор

Questions? Comments? Tweet me @twostraws.

twostraws
Автор

I am so glad I found this. Strings were driving me nuts. Why can it be so easy in Python but do hard in Swift ?

hv
Автор

Wait a second. As far as I understand, a subscript should be O(1), but when you use that index, you have to traverse the collection, that is, O(n). So, is what you are doing right? I almost sure apple docs mention that subscript must be O(1).

EDIT: I just heard your last sentence :)

ricardoruiz
welcome to shbcf.ru