Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert NSString to NSArray [duplicate]

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.

like image 791
user1954352 Avatar asked Jul 24 '26 01:07

user1954352


1 Answers

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

should do the job.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!