How to write multiple line property value using PropertiesConfiguration?

前端 未结 4 2084
面向向阳花
面向向阳花 2020-12-08 03:53

I have a properties file with a property with a List value (comma separated), how to write this property in a multi-line ? (backslash after the comma)?

I can\'t find

4条回答
  •  被撕碎了的回忆
    2020-12-08 04:05

    Check the User Guide for Properties files:

    Special Characters and Escaping:

    If you need a special character in a property like a line feed, a tabulation or an unicode character, you can specify it with the same escaped notation used for Java Strings. The list separator ("," by default), can also be escaped:

    key = This \n string \t contains \, escaped \\ characters \u0020

    Backslashes are more difficult.

    Lists and arrays:

    You can specify a list of values in your properties file by using the same key on several lines:

    # chart colors
    colors.pie = #FF0000;
    colors.pie = #00FF00;
    colors.pie = #0000FF;
    

提交回复
热议问题