var str = "a b c"
var arr = split(str) {$0 == " "}
// => [a,b,c]
import Foundation
var arr = str.componentsSeparatedByString(" ")
// => [a,b,c]
どっちでもできるけど、下の方が綺麗な感じがします。
Go to list of users who liked
More than 5 years have passed since last update.
var str = "a b c"
var arr = split(str) {$0 == " "}
// => [a,b,c]
import Foundation
var arr = str.componentsSeparatedByString(" ")
// => [a,b,c]
どっちでもできるけど、下の方が綺麗な感じがします。
Register as a new user and use Qiita more conveniently
Go to list of users who liked