草庐IT

clipLength

全部标签

iphone - 在 Objective-c 中截断字符串并在末尾添加省略号

如何在Objective-C中截断字符串,然后在末尾添加省略号? 最佳答案 NSString*origString=@"Averylongstringblahblahblah";constintclipLength=18;if([origStringlength]>clipLength){origString=[NSStringstringWithFormat:@"%@...",[origStringsubstringToIndex:clipLength]];} 关于iphone-在Ob

iphone - 在 Objective-c 中截断字符串并在末尾添加省略号

如何在Objective-C中截断字符串,然后在末尾添加省略号? 最佳答案 NSString*origString=@"Averylongstringblahblahblah";constintclipLength=18;if([origStringlength]>clipLength){origString=[NSStringstringWithFormat:@"%@...",[origStringsubstringToIndex:clipLength]];} 关于iphone-在Ob