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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -