【发布时间】:2016-12-23 00:28:52
【问题描述】:
【问题讨论】:
【问题讨论】:
String 不是序列,您需要调用characters 属性来获取sequence。
let a = "what is this"
for b in a.characters {
print(b, terminator: "")
}
// "what is this"
【讨论】:
如果需要,您必须使用String 的characters 成员变量
枚举所有字符。
let a = "what is this"
for b in a.characters
{
print(b)
}
【讨论】: