How to count how many characters a string has - Swift

2

I'm having some difficulties with simple things. How do I count how many letras has a variable?

let word = wordEasy[0]
for var i = 0; i < word.count ?????
    
asked by anonymous 22.01.2016 / 18:22

1 answer

4

If it is Swift 1 :

word.utf16count

If it is Swift 2 :

word.characters.count
    
22.01.2016 / 18:27