I have the IP-Address 123.234.1.456:1234. Is there a way to represent it in a general form of string like how it is done in other languages. for exmaple "*. *. * . * : *", so that I can replace that IP Address wth the any new IP Address. I want to replace the IP Address that is written in a file with the new IP Address, but don't know how to locate previous IP Address from file. The file has html code in which IP Address is present, and I want to replace the IP Address present in it with new one.
Currently m using this way:
NSRange startRange = [html rangeOfString:@"http://"];
NSRange endRange = [html rangeOfString:@"/a.json?"];
if(startRange.location != NSNotFound && endRange.location != NSNotFound)
{
NSString *oldIPString = [html substringWithRange:NSMakeRange(startRange.location+startRange.length, endRange.location)];
html = [html stringByReplacingOccurrencesOfString:oldIPString withString:ipAdressString];
}
Please help. Thanks in advance.