I defined a .properties file with properties like this
A=Hello World this is a dummy text
B=Bye Bye World I am leaving to mars
I am able to read it properly after loading resource from input stream and display them good.
Now i want to define these properties like this
A= Hello World
this is a
dummy text
B= Bye Bye World
I am leaving to
mars
However it don't load it as expected
A as Hello World
and
B as Bye Bye World.
Do i have to go by myself defining a regex and read this and fill it in a map.
Or is there any way default available in Properties.java
?
You need to add a \n
and then end the line with the "continuation" character: \
A=Hello World\n \ this is a\n \ dummy text
Note that leading whitespace is trimmed when loading the Properties file. So you need to add that to the end of the previous line if you need indented lines:
A=Hello World\n \ this is a\n \ dummy text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With