开发者

UITextView formatting

I have a UITextView that shows me the following: 333, nik, 222 开发者_运维知识库I just want to separate these texts and to show me:

Number: 333
User: nik
Visits: 222

how I can do?


NSString *longString = myTextView.text;
NSArray *array = [longString componentsSeparatedByString:@", "];
NSString *formattedString = [NSString stringWithFormat:@"Number: %@ User: %@ Visits: %@", [array objectAtIndex:0], [array objectAtIndex:1], [array objectAtIndex:2]];


UITextView *textView;

textView.text = @"Number: 333\nUser: nik\nVisits: 222";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜