how to read property name with spaces in java

后端 未结 4 748
甜味超标
甜味超标 2020-12-18 20:04

I am trying to load all the property names present in the properties file using the below code:

for(Enumeration en = (Enumeration         


        
4条回答
  •  情歌与酒
    2020-12-18 20:27

    In Java.util.Properties , =, :, or white space character are key/value delimiter when load from property file.

    Below are detailed Javadoc of its public void load(Reader reader)

    The key contains all of the characters in the line starting with the first non-white space character and up to, but not including, the first unescaped =, :, or white space character other than a line terminator. All of these key termination characters may be included in the key by escaping them with a preceding backslash character. http://docs.oracle.com/javase/6/docs/api/

提交回复
热议问题