dwaite
(David Waite)
15
No.
> "\r\n".count
Int = 1
> "\r\n".unicodeScalars.count
Int = 2
This sequence, while two unicode scalars, is a single grapheme cluster (in Swift, a single Character.)
What I have done in the past is to operate in the realm of representing fixed-size unicode scalars, and convert to/from that for Swift String types.