开发者

Objective C version of explode()?

If I want to explode a string by parts in PHP into an array, I have the nifty explode() function where I just do the following

$mystring = "HI:THERE:HOW";
$stringarray = explode(":", $mystring);

And I get

$stringarray = (
  [0] = "HI"
  [1] = "THERE"
  [2] = "HOW"
);

Is there a similar function in Objective C that expl开发者_StackOverflow中文版odes a string into an array? Thanks for any help!


NSArray *stringArray = [myString componentsSeparatedByString:@":"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜