Replacing string between two string iphone sdk -


in objective c want replace string between 2 string.

for example "ab anystring yz"

i want replace string between "ab" , "yz".

is possible do? please help

thx in advance.

nsstring *newstring = [(nsstring *)youroldstring stringbyreplacingoccurrencesofstring:@"anystring" withstring:@""]; 

otherwise you're going have copy of regexkitlite , use regex function like:

nsstring *newstring = [(nsstring *)youroldstring stringbyreplacingoccurrencesofregex:@"ab\\b.\\byz" withstring:@"ab yz"]; 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -