java - java 属性文件中的 "\"是什么意思?

标签 java properties escaping

您好,我正在处理一些 java .proeprties 文件。

我想知道a行末尾的“\”是什么意思,例如:

pay.checkPrint.shellfish=You need to be the target of feature. \
    Features are setup.  <a id="desclink" href="{0  }">Click here</a> to work.

是不是跟下面的一样?

pay.checkPrint.shellfish=You need to be the target of feature. Features are setup.  <a id="desclink" href="{0  }">Click here</a> to work.

一分钱

最佳答案

这是一种转义结束行字符的简单方法。

来自Oracle ATG Programming Guide (我看到此链接也已在评论中链接):

A property value can span several lines if each line is terminated by a backslash (‘\’) character. For example:

targetCities=\  
      Detroit,\  
      Chicago,\  
      Los Angeles  

This is equivalent to targetCities=Detroit,Chicago,Los Angeles (white space at the beginning of lines is ignored).

编辑: 正如@erickson 所建议的,我在答案中添加了 Properties 的权威规范。

关于java - java 属性文件中的 "\"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36142531/

相关文章:

Java 系统属性和环境变量

javascript - 按钮值未显示 -javascript

ruby-on-rails - 如何转义 yield 返回的值

java - 包 oracle.jdbc.driver 不存在

构建元数据库时 java.lang.AbstractMethod 错误

java - 在解析 json 数组的适配器类中实现搜索过滤器(不使用 pojo)

windows - 禁用sed中反斜杠的转义功能

java - Gradle:将 web-inf/libs 复制到 war 根目录

C++ MFC 属性并获取选中的子项

windows - 如何在Windows命令行中转义参数?