空字符串

基本类型 / 字符串

// 空字符串字面量
let someEmptyString = ""
// 构造器语法
let anotherEmptyString = String()

if someEmptyString.isEmpty {
    print("some string is empty")
}

if anotherEmptyString.isEmpty {
    print("another string is empty")
}