Tuesday, 20 May 2014

Replace specific string from a long text or line in iOS

 NSString *stringFromChange = [NSString stringWithFormat:@"hi this is pankaj"]];

    
stringFromChange = [stringFromChange stringByReplacingOccurrencesOfString:@"hi"

                                           withString:@"hello"];

// Now output : hello this is pankaj