Swift(3)String and Character

前端之家收集整理的这篇文章主要介绍了Swift(3)String and Character前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

文档地址:

https://developer.apple.com/library/prerelease/content/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-ID285

1Initializing an Empty String

var emtyString = “”

var anotherEmptyString = String()

两种初始化方法

2、Find out whether a String value is empty by checking its Boolean isEmpty property

if emptyString.isEmpy {

print(“Nothing to see here”)

}

3、override 计算机里面是覆盖的意思

4、变量能修改,常量不能修改,这个与oc里面的字符串不一样

5、for character in “Dog!

原文链接:https://www.f2er.com/swift/322037.html

猜你在找的Swift相关文章