如何在 ios 中的指定字符(在我的例子中为“;”)之后换行并换行
How to Break the line and make new line only after specified character ( ";" in my case ) in ios
我想换行并在 UITableViewCell
中换行。那也只有在指定字符 [;]
之后
// the code im using is
loadLbl.numberOfLines=0;
loadLbl.lineBreakMode = NSLineBreakByWordWrapping;
但是有了这个,我并没有得到我想要的。
我只想在 ;
之后换行
[Objective-C]
代码:
NSString *text = @"text;with;string";
NSString *newText = [text stringByReplacingOccurrencesOfString:@";" withString:@";\n"];
结果:
text;
with;
string
我想换行并在 UITableViewCell
中换行。那也只有在指定字符 [;]
// the code im using is
loadLbl.numberOfLines=0;
loadLbl.lineBreakMode = NSLineBreakByWordWrapping;
但是有了这个,我并没有得到我想要的。
我只想在 ;
之后换行[Objective-C]
代码:
NSString *text = @"text;with;string";
NSString *newText = [text stringByReplacingOccurrencesOfString:@";" withString:@";\n"];
结果:
text;
with;
string