Posted By

ibob on 02/07/13


Tagged


Versions (?)

explode function


 / Published in: Objective C
 

  1. NSArray* explode(NSString *separator, NSString *text){
  2. return [text componentsSeparatedByString:separator];
  3. }
  4.  
  5. //Example
  6.  
  7. NSArray *arr = explode( @", " , @"One, Two, Three");
  8.  
  9. //Result: ["One", "Two", "Three"]

Report this snippet  

You need to login to post a comment.