How to escape the equals sign in properties files

joshua picture joshua · Mar 9, 2010 · Viewed 108.5k times · Source

How can I escape the equals sign (=) in Java property files? I would like to put something as the following in my file:

table.whereclause=where id=100

Answer

wrschneider picture wrschneider · Jul 15, 2013

In your specific example you don't need to escape the equals - you only need to escape it if it's part of the key. The properties file format will treat all characters after the first unescaped equals as part of the value.