[Swift]split

split

let t:String = "yyyy-MM-dd HH:mm:ss"
//let tmp:[String] = split(t, {$0 == "-" || $0 == " " || $0 == ":"}) //この方法でもよい
let tmp:[String] = split(t, {contains(["-"," ",":"],$0)})
println(tmp)

出力結果

[yyyy, MM, dd, HH, mm, ss]