I know its noob question, i really search around before ask. But there is not exact answer of what i want to know. How we split string into the array without using Objectiv
"I know it doesnt work"
Well, for me, it does. In the Swift REPL:
1> import Foundation
2> "a b c".componentsSeparatedByString(" ")
$R6: String[] = size=3 {
[0] = {
core = {
_baseAddress = Builtin.RawPointer = 0x0000000100407980
_countAndFlags = -4611686018427387903
_owner = Some {
Some = @"a"
}
}
}
[1] = {
core = {
_baseAddress = Builtin.RawPointer = 0x0000000100408e50 -> 0x00007fff7cde0062 (void *)0x001b00007fff7cdd
_countAndFlags = -4611686018427387903
_owner = Some {
Some = @"b"
}
}
}
[2] = {
core = {
_baseAddress = Builtin.RawPointer = 0x0000000100408dd0
_countAndFlags = -4611686018427387903
_owner = Some {
Some = @"c"
}
}
}
}