目前我正在使用xcode8.调用函数的时候需要参数的名字,像这样
sayHello(name:"慕课女神")
sayHello(name:"慕课女神")
2017-06-28
3.0 trim
var str_c = " a c c "
str_c.trimmingCharacters(in: .whitespacesAndNewlines)
var str_c = " a c c "
str_c.trimmingCharacters(in: .whitespacesAndNewlines)
2017-05-16
newArr.sorted(by: {(a: Int, b: Int) -> Bool in
return a > b
})
可以写成这样哦
newArr.sorted(by: {
return $0 > $1
})
return a > b
})
可以写成这样哦
newArr.sorted(by: {
return $0 > $1
})
2017-04-13
func compareTwoString(s1: String, s2: String) -> Bool {
return s1.characters.count == s2.characters.count ? s1 < s2 : s1.characters.count < s2.characters.count
}
return s1.characters.count == s2.characters.count ? s1 < s2 : s1.characters.count < s2.characters.count
}
2017-04-12