SyntaxFix
Write A Post
Hire A Developer
Questions
You could use SwiftString (https://github.com/amayne/SwiftString) to do this.
"string".length // 6
DISCLAIMER: I wrote this extension