开发者

text file question

开发者 https://www.devze.com 2023-03-10 18:48 出处:网络
I have text file that w开发者_运维问答ith the following structure: test\\n 1\\n 2\\n @/@/@/\\n test2 \\n

I have text file that w开发者_运维问答ith the following structure:

test\n 
1\n
2\n
@/@/@/\n
test2 \n
223\n
44\n
@/@/@/\n

I can read it in array successfuly , but the line @/@/@/ is separator. I want to divide the NSArray to sub arrays at the separator.

Any suggestion how to solve that?

I also need to modify certain section.

Best regards


If you read it in as a NSString then

NSArray *chunks = [string componentsSeparatedByString: @"@/@/@/"];


Use componentsSeparatedByString method.You can store the value obtained in an Array.

0

精彩评论

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