1

文字列の例:

NSString * exampleString = 
@""
 "#--- delimiter2 ---"
 "bla,"
 "bla,"
 "bla"
 "#--- delimiter2 ---"
 "yoip,"
 "yoip,"
 "yoip"
 "#--- delimiter3 ---"
 "etc,"
 "etc,"
 "etc,"
 "etc,"
 "etc,"
 "etc,"
 "etc";

配列を取得して、次のように入力します。

[anyArray objectAtIndex:0] = @"bla,bla,bla"

[anyArray objectAtIndex:1] = @"yoip,yoip,yoip"

[anyArray objectAtIndex:2] = @"etc,etc,etc,etc,etc,etc,etc"

それが理にかなっているなら...

どんな助けでも大歓迎です:)

ありがとう

4

1 に答える 1

5
NSArray *spliArray = [exampleString componentsSeparatedByString:@"delimiter"];
于 2012-04-20T11:29:48.803 に答える