想知道在目標C中是否有一種簡單的HTML轉(zhuǎn)義/取消轉(zhuǎn)義的方法。我想要的是這樣的psuedo代碼:NSString *string = @"<span>Foo</span>";[string stringByUnescapingHTML];返回<span>Foo</span>希望能夠擺脫所有其他的HTML實體,甚至是像?之類的ASCII代碼。Cocoa Touch/UIKit中有什么方法可以做到這一點嗎?
3 回答

收到一只叮咚
TA貢獻1821條經(jīng)驗 獲得超5個贊
- (NSString *)stringByStrippingTags;- (NSString *)stringByDecodingXMLEntities; // Including all HTML character references - (NSString *)stringByEncodingXMLEntities;- (NSString *)stringWithNewLinesAsBRs; - (NSString *)stringByRemovingNewLinesAndWhitespace;
- 3 回答
- 0 關(guān)注
- 784 瀏覽
添加回答
舉報
0/150
提交
取消