官术网_书友最值得收藏!

Empty Strings

Empty Strings can be initialized as follows:

// Initializing an Empty String 
var anEmptyString = ""
var anotherEmptyString = String()

These two strings are both empty and equivalent to each other. To find out whether a String is empty, the isEmpty property can be used as follows:

if anEmptyString.isEmpty { 
print("String is empty")
}
主站蜘蛛池模板: 米易县| 邯郸县| 台中县| 霍山县| 镇原县| 封开县| 四子王旗| 邢台市| 延津县| 荆州市| 苏尼特左旗| 大田县| 容城县| 天柱县| 登封市| 宁夏| 丰镇市| 健康| 东山县| 阿鲁科尔沁旗| 略阳县| 胶南市| 精河县| 阿尔山市| 汉川市| 城口县| 陈巴尔虎旗| 河南省| 红安县| 临武县| 绥江县| 精河县| 天镇县| 榆树市| 化州市| 雷州市| 宣威市| 景洪市| 龙门县| 中方县| 吉林省|