explode function


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.