commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [Configuration]: Escaping list delimiter
Date Fri, 18 May 2007 14:28:39 GMT
uma_rk@comcast.net wrote:
> How can I escape list delimiter characters in property configuration?
> 
>     my.strings=silk,cotton               # List of two strings
>     my.strings=silk,cott\,on             # List of two strings again
>     my.strings=silk,cott,on              # List of three strings
> 
> However, escaping the list delimiter as above does not seem to work.
> How can I accomplish what I am trying to do?
> 
> Thanks,
> 
> /U
> 
The backslash is the correct escaping character. But AFAIK it is
specially treated in Java properties files [1], so it has to be escaped
itself by using a duplicate backslash:

my.strings = silk,cott\\,on

HTH
Oliver

[1]
http://java.sun.com/javase/6/docs/api/java/util/Properties.html#load(java.io.Reader)

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message