字符串
let str = "叼到飞起来"
// for循环字符串
for s in str.characters {
print(s)
}
// 打印字符串的长度
print(str.characters.count)
// 转换成OC字符串(as: 类型转换)
let ocStr = str as NSString
print(ocStr.length)
// 字符串拼接
let firstName = "Jerry"
let lastName = "Yao"
let age = 18
let fullName = firstName + lastName
print(fullName)
let desc = "Name is \(firstName) and age is \(age)"
print(desc)
// 字符串格式化
let h = 3
let m = 4
let s = 8
let time = String(format: "%02d:%02d:%02d", h, m, s)
print(time)