in objective c i want to replace string which is between two string.
For example "ab anystring yz"
i want to replace string which is between "ab" and "yz".
is it possible to do? Please Help
thx in advance.
in objective c i want to replace string which is between two string.
For example "ab anystring yz"
i want to replace string which is between "ab" and "yz".
is it possible to do? Please Help
thx in advance.
NSString *newString = [(NSString *)yourOldString stringByReplacingOccurrencesOfString:@"anystring" withString:@""];
otherwise you're going to have to get a copy of REGEXKitLite and use a regex function like:
NSString *newString = [(NSString *)yourOldString stringByReplacingOccurrencesOfRegex:@"ab\\b.\\byz" withString:@"ab yz"];