Google Toolbox for Mac字符串分类
要运行示例项目,首先复制仓库,然后从示例目录运行pod install
。
要在项目中使用,只需导入/包含包并按以下方式开始:
NSString* raw_html_string = @"Here's a raw html string you'll want to escape. 10 > 4 && 6 < 8.";
NSString* unescaped_string = [raw_html_string gtm_stringByUnescapingFromHTML];
NSLog(@"%@", unescaped_string); // Here's a raw html string you'll want to escape. 10 > 4 && 6 < 8.
let raw_html_string = "Here's a raw html string you'll want to escape. 10 > 4 && 6 < 8."
let unescaped_string = raw_html_string.gtm_stringByUnescapingFromHTML()
println(unescaped_string) // Here's a raw html string you'll want to escape. 10 > 4 && 6 < 8.
GTMNSStringHTMLAdditions通过CocoaPods提供。要安装它,只需将以下行添加到Podfile中:
pod "GTMNSStringHTMLAdditions"
GTMNSStringHTMLAdditions在Apache许可证下提供。有关更多信息,请参阅LICENSE文件。