I want to append string to Label.
str1 = Hello;
Str2 = Hi;
I am able to append two string but it shows me like "Hello Hi", I want second string in new line like
Hello
Hi
Please any one suggest me how can i do that?
You have to use an escape sequence. "\\n".
NSString *str1 = @"Hello";
NSString *str2 = @"Hi";
NSString *finalString = [NSString stringWithFormat:@"%@\n%@", str1, str2];
finalString contains the result that you want.
Objective-C中的换行符为\\n
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.