I have a line:
NSString *s = @"a+v+c+d";
Where '+'is the separator.
'+'
I want to save everyone a,b,c,din array. How can this be done in objective C?
a,b,c,d
array
- (NSArray *)componentsSeparatedByString:(NSString *)separator
- the method you are looking for
NSArray *yourArray = [yourString componentsSeparatedByString:@"+"];
-[NSString componentsSeparatedByString:]returns a, v, c, d as elements in NSArray. Use -[NSString componentsSeparatedByCharactersInSet:]if you have more than one separator.
-[NSString componentsSeparatedByString:]
NSArray
-[NSString componentsSeparatedByCharactersInSet:]
Source: https://habr.com/ru/post/1761710/More articles:How can I get a Haskell installation to read in Cygwin? - haskellChanging text at points in a text field using CSS / Javascript - javascriptWhat parts of asp.net, C #, and the database should be used to create a forum like stackoverflow? - asp.netDifferences between Oracle hash and tomcat md5? - oracleИерархические данные в StringTemplate - stringtemplateкак отображать текст в UIWebVIew - objective-cDataGridView rows cannot change background color during initialization - c #Как убить службу Windows с пробелом в имени с помощью taskkill в пакетном файле - service.NET socket lock processing timeout - c #Convert type string to object type - c #All Articles