dcsimg
Spaces in a properties file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Louise_Rochford
Posted On:   Monday, December 16, 2002 04:28 AM

How can I specify spaces in a properties file?


If I enter key= and a space, I think that the space will be ignored. Do I need to enter it in single quotes key=' ', or as a unicode value key=u0020, or some other way?


Will ClassLoader.getSystemResourceAsStream(PROPERTIES_FILE) & Properties handle the space OK?

Re: Spaces in a properties file

Posted By:   Stephen_Ostermiller  
Posted On:   Monday, December 16, 2002 05:12 AM

All white space at the start or end of a key or value is ignored. If you want an actual space in these locations, escape it with a (backslash space)

k=
(key equals space) will have the empty string for k.
k=
(key equals backslash space) will have a space for k.
About | Sitemap | Contact