到目前为止,它是:
let string = "my example string" if count(string) >= 3 { ... }
但是现在我得到一个错误:
count
is unavailable: access thecount
property on the collection. TypeString
doesn’t conform to protocolCollectionType
哦,很简单:
string.characters.count