Java: possible to line break in a properties file?

前端 未结 3 975
天命终不由人
天命终不由人 2021-01-31 01:00

Is it possible to continue a long string on the next line in a Java properties file?

e.g., somehow

myStr=Hello
      World

and when I g

3条回答
  •  猫巷女王i
    2021-01-31 01:37

    You need to use \n\ as a solution.

    First two symbols \n - new line for string, third \ - multi-line in properties file.

    For example (in application.properties):

    mail.bodyText=Hello.\n\
    This is notification.
    

提交回复
热议问题