我有以下格式的 URL 字符串。
http://myserver.com/_layouts/feed.aspx?xsl=4&web=%2F&page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&wp=476f174a-82df-4611-a3df-e13255d97533
我想用 &
替换上面 URL 中的 &
。我的结果应该是:
http://myserver.com/_layouts/feed.aspx?xsl=4&web=%2F&page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&wp=476f174a-82df-4611-a3df-e13255d97533
有人可以将完成此操作的代码发给我吗?
谢谢
查看我的 NSString category for HTML .以下是可用的方法:
// Strips HTML tags & comments, removes extra whitespace and decodes HTML character entities.
- (NSString *)stringByConvertingHTMLToPlainText;
// Decode all HTML entities using GTM.
- (NSString *)stringByDecodingHTMLEntities;
// Encode all HTML entities using GTM.
- (NSString *)stringByEncodingHTMLEntities;
// Minimal unicode encoding will only cover characters from table
// A.2.2 of http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters
// which is what you want for a unicode encoded webpage.
- (NSString *)stringByEncodingHTMLEntities:(BOOL)isUnicode;
// Replace newlines with <br /> tags.
- (NSString *)stringWithNewLinesAsBRs;
// Remove newlines and white space from string.
- (NSString *)stringByRemovingNewLinesAndWhitespace;