Objective C版本的explode()?

Rap*_*eta 25 c iphone objective-c

如果我想将PHP中的部分字符串分解为数组,我有一个漂亮的explode()函数,我只是执行以下操作

$mystring = "HI:THERE:HOW";
$stringarray = explode(":", $mystring);
Run Code Online (Sandbox Code Playgroud)

我明白了

$stringarray = (
  [0] = "HI"
  [1] = "THERE"
  [2] = "HOW"
);
Run Code Online (Sandbox Code Playgroud)

Objective C中是否有类似的函数将字符串分解为数组?谢谢你的帮助!

ind*_*gie 88

NSArray *stringArray = [myString componentsSeparatedByString:@":"];
Run Code Online (Sandbox Code Playgroud)