如何在ios中解码html数据?

时间:2017-03-21 06:27:14

标签: html ios objective-c decoding

我的表格中有数据:

%3Cp%3E%3Cstrong%3Ee-AWB+and+e

我必须对此进行解码并在Webview / UILabel中显示!

我试过这个 - URL Decoding,但它并不适合我

1 个答案:

答案 0 :(得分:0)

使用此 -

- (NSString *)URLDecode:(NSString *)htmlString
{
    NSString *decodedURL = [htmlString stringByReplacingOccurrencesOfString:@"+" withString:@" "];
    decodedURL = [decodedURL stringByRemovingPercentEncoding];
    return decodedURL;
}

这里输出为 - <p><strong>e-AWB and e