It's not bad, but Swift still does better:
* String.Index is an opaque type (ideally it would be linked to a specific string too)
* it returns grapheme cluster counts by default, that's probably the least surprising / useless though not necessarily super useful either
* other lengths go through explicit lazy views e.g. string.utf8.count will provide the UTF8 code units count, string.unicodeScalars.count will provide the USVs count
> If you switch to s.chars().count(), you’ll get UTF-8 scalar values
You get unicode scalar values (which I assume is what you meant).