Swift中字符串,字典,数组,集合的遍历
//字符串的遍历(3中写法)(1)var str = "China"for item in str.characters { print(item)(2)for item in str.characters.indices { print(str[item])}(3)var i = 0while i < str.characters.count { let i