It's for a j2me project I'm working on where I need to retrieve some Strings from a messages.properties files where the first characters of the Strings are spaces.
If the first character of a value in a properties file is a white space, you need to escape it using a backslash.
See the JavaDoc for Properties.load for more detailed explanation.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
James Hodgkiss
Ranch Hand
Joined: Jan 22, 2004
Posts: 401
posted
0
Cheers guys.
Yeah, I hit the wrong button. (I was wondering why I had to enter the message subject again... )
There are no double apostrophes in the properties file, hence leading spaces aren't detected. But I had a look at the Properties javadoc, and the escape sequence for a space is "\ ", so my properties file entry is now like:
thisKey = \ \ \ some string where the first three chars are spaces!
Thanks again, James
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Does anyone know if there is an escape character that represents a space?