【发布时间】:2020-12-17 19:11:58
【问题描述】:
如何删除这个 NSAttributedString 的最后两行?
NSString *exampleString = @"line 1\nline 2\nline 3\nline 4"
NSAttributedString *as = [NSAttributedString alloc] int];
[as setString:exampleString];
[self removeLastTwoLinesOfAttributedString:as];
NSLog(@"%@",as);
-(void)removeLastTwoLinesOfAttributedString:(NSAttributedString *)string {
//some code here
}
我想在这个例子中以 @"line 1\nline 2" 结尾。谢谢
【问题讨论】:
标签: ios objective-c nsattributedstring