"; NSArray *arr = @[@"1、(" ,@"),2、(" ,@"),3、(" ,@"),4、(" ,@"),5、(" ,@"),6、(" ,@"),7、(" ,@"),8、(" ,@"),9、(" ,@"),10、(" ,@")。"]; BOOL isZH = [ZLUtils isChineseString:text]; if (isZH) { NSString *str = [self getllUnitsByString:text]; NSString *str1 = [str substringFromIndex:1]; self.myLabel.text = [NSString stringWithFormat:@"%@%@",str1,arr[arc4random_uniform(10)]]; }else { self.myLabel.text = [NSString stringWithFormat:@"请优化中文内容的描述~"]; }}#pragma mark- 获取中文字符串- (NSString *)getllUnitsByString:(NSString *)string { NSMutableString *str = [NSMutableString string]; for (int i = 0;i < string.length ;i ) { if ([ZLUtils isChineseString:[NSString stringWithFormat:@"%c",[string characterAtIndex:i]]]) { [str appendString:[NSString stringWithFormat:@"%c",[string characterAtIndex:i]]]; } } return str;}@end
免責聲明:若本站收錄的資源侵犯了您的權益,我們會及時刪除侵權內容,謝謝合作!