NSString with \n or line break

前端 未结 10 814
生来不讨喜
生来不讨喜 2020-12-04 11:15

Does anyone know how to use line breaks in NSString? I need to do something like this -

[NSString stringWithFormat:@\"%@,\\n%@\", mystring1,mystring2];
         


        
10条回答
  •  -上瘾入骨i
    2020-12-04 11:47

    NSString *str1 = @"Share Role Play Photo via Facebook, or Twitter for free coins per photo.";
    NSString *str2 = @"Like Role Play on facebook for 50 free coins.";
    NSString *str3 = @"Check out 'What's Hot' on other ways to receive free coins";
    
    
    NSString *msg = [NSString stringWithFormat:@"%@\n%@\n%@", str1, str2, str3];
    

提交回复
热议问题