NSString with \n or line break

前端 未结 10 827
生来不讨喜
生来不讨喜 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条回答
  •  抹茶落季
    2020-12-04 11:41

    \n\r seems working for me.

    I am using Xcode 4.6 with IOS 6.0 as target. Tested on iPhone 4S. Try it by yourself.

    Feng Chiu

提交回复
热议问题