let elem1 = 1
let elem2 = 2
let str = String(format:"%02d:%02d",elem1,elem2)
print(str)
let name = "zz"
let age = 11
let height = 1.22
let info = "my name is \(name),age is \(age),height is \(height)"
let urlString = "www.sss.com"
let header = (urlString as NSString).substring(to: 3)
let body = (urlString as NSString).substring(with: NSMakeRange(4, 3))
let footer = (urlString as NSString).substring(from: 8)
for c in urlString.characters {
print(c)
}
let str4 = "hello"
let str5 = "world"
let str6 = str4 + str5
网友评论