How to insert a new line in strings in Android

后端 未结 4 1493
生来不讨喜
生来不讨喜 2020-12-05 09:11

This may seem like a stupid question, but I\'ve been searching and can\'t find an answer.

I\'m creating an android application and within it there is a button that w

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 10:09

    Try:

    String str = "my string \n my other string";
    

    When printed you will get:

    my string
    my other string

提交回复
热议问题