Parsing a message in Objective C

Can someone help me how to parse a message in objective C

The return message that I get from JSON is “Test1|Test2|Test3|Test4|Test5”. How to parse the message to only take Test5 in Objective C? Please advice.


Try something like this… sorry if I got some syntax errors… I don’t have x-code here:

NSString *foo = “Test1|Test2|Test3|Test4|Test5”;
NSArray *bar = [foo componentsSeparatedByString: @"|"];
NSLog (@"%@", [bar objectAtIndex:4]);