我想删除存储在属性文件中的键和值。我该怎么做????
最佳答案
第一个load()
它使用 java.util.Properties
API。
Properties properties = new Properties();
properties.load(reader);
然后你可以使用remove()
方法。
properties.remove(key);
最后 store()
它到文件。
properties.store(writer, null);
另见:
关于java - 从属性文件中删除键和值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4225794/