【发布时间】:2010-12-29 11:30:04
【问题描述】:
我想从我的字符串中删除标签。
例如,
NSSTring *str = @"<null>";
My expected output is null.
所以我想删除 HTML 标签。
所以请指导我。
谢谢。
.
【问题讨论】:
标签: iphone objective-c ios tags nsstring
我想从我的字符串中删除标签。
例如,
NSSTring *str = @"<null>";
My expected output is null.
所以我想删除 HTML 标签。
所以请指导我。
谢谢。
.
【问题讨论】:
标签: iphone objective-c ios tags nsstring
试试,
str = [str stringByReplacingOccurrencesOfString:@"<" withString:@""];
str = [str stringByReplacingOccurrencesOfString:@">" withString:@""];
【讨论】:
如果要删除“”符号,可以使用以下代码。
string = [string stringByReplacingOccurrencesOfString:@"<" withString:@""];
string = [string stringByReplacingOccurrencesOfString:@">" withString:@""];
【讨论】: