开发者

Change HTML characters in URL in xcode

given a URL like this:

http%3A%2F%2Fwww.environmental-expert.com%2FresultEachPressRelease.aspx%3Fcid%3D23745%26codi%3D2开发者_StackOverflow34441%26lr%3D1

How can i replace the characters (like %3D and so on) to get a normal url using the iphone sdk?

thanks in advance!


Try:

NSString *myEscapedUrl = @"http%3A%2F%2Fwww.environmental-expert.com%2FresultEachPressRelease.aspx%3Fcid%3D23745%26codi%3D234441%26lr%3D1";

NSLog(@"my unescaped url: %@", [myEscapedUrl stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜