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