properties 读取 字符串

来源:互联网 发布:淘宝企业店铺 企业资质 编辑:程序博客网 时间:2024/06/05 13:23
Properties proper = new Properties();proper.load(new StringReader(config)); //把字符串转为readerEnumeration enum1 = proper.propertyNames();while (enum1.hasMoreElements()) {    String strKey = (String) enum1.nextElement();    String strValue = proper.getProperty(strKey);    map.put(strKey, Integer.valueOf(strValue));}
字符串示例 :    
A=1
B=2
C=3
原创粉丝点击