Search code examples
iosnsstringnsmutablestring

How to change the values in the string between the letters


I have string something like @"goodhouse=30&app=60&val=30askldkla" How can I found the value 30 between house= and &, and change it on 50?


Solution

  • if ([yourString rangeOfString:@"30"].location==NSNotFound) {
    yourString = [yourString stringByReplaceOccurenceOfString:@"30" withString@"60"];

    }