SyntaxFix
Write A Post
Hire A Developer
Questions
If you only need the index of a character the most simple, quick solution (as already pointed out by Pascal) is:
let index = string.characters.index(of: ".") let intIndex = string.distance(from: string.startIndex, to: index)