objective c - split NSString using componentsSeparatedByString -


i have string need split. easy using componentsseparatedbystring problem separator comma have commas aren't separator.

i explain:

my string:

nsstring *str = @"black,red, blue,yellow"; 

the comma between red , blue must not considered separator.

i can determine if comma separator or not checking if after there white space.

the goal obtain array with:

( black, "red, blue", yellow ) 

this tricky. first replace occurences of ', ' (comma+space) '|' use components separated method. once done, again replace '|' ', ' (comma+space).


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -