2

I have one string as follows:

NSString *str = @"abcd,efgh";

Now I want to convert this string into NSMutableArray like

NSMutableArray *arr = {abcd,efgh};

then how can I do this?

any help would be appreciated.

Serg
  • 2,346
  • 3
  • 29
  • 38
user1954352
  • 1,577
  • 4
  • 14
  • 16
  • 1
    This is very basic stuff, do your self a favor and read the [documentation](https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html)... – Alladinian Mar 07 '13 at 12:40
  • 1
    {abcd,efgh}; is a dictionary not array.In which form do you want to convert? – Niru Mukund Shah Mar 07 '13 at 12:40

1 Answers1

13
NSArray *arr = [@"abcd,efgh" componentsSeparatedByString:@","];

should do the job.