我想在 NSArray 中获取具有特定长度的字符串。
数组有很多元素,我不想使用快速枚举。
有什么办法吗?
最佳答案
这就像一个魅力:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self.length == %d", lenght];
NSArray *filtered = [array filteredArrayUsingPredicate:predicate];
关于objective-c - 如何从 NSArray 获取特定长度的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10208355/