拼接字符串,数字分割;
//拼接字符串,数字分割;
- (void)splicingString {
NSInteger index = 1;
self.suggestString = [NSString string];
[self.suggestString appendString:self.textView.text];
if ([self.suggestString length] > 0) {
[_suggestString appendString:@"\n"];
}
for (NSString *part in self.suggestArray) {
NSString *suggest = [NSString stringWithFormat:@"%ld、%@", (long)index, part];
[_suggestString appendString:suggest];
if (index < self.suggestArray.count) {
[_suggestString appendString:@"\n"];
} else {
// ignore
}
index ++;
}
}