Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 490 Bytes

File metadata and controls

20 lines (15 loc) · 490 Bytes

Overview

  1. Notes about java.util.Properties

Spaces in property key

  1. Use double back slash to escape a space in a key
  2. No need to escape spaces in the value (since it is after the =)
  3. Try it yourself:
final var p = new Properties();
p.load(new StringReader("""
        a\\ b\\ c = foo bar
        """));

assertEquals("foo bar", p.getProperty("a b c"));

Other Resources

  1. https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Properties.html