propertiesEncode()

Additional XPath Functions

propertiesEncode

Reutnr a string encoded to conform to rules for Java properties files


Function Summary
 
minimal arguments String propertiesEncode (String text)
 
all arguments String propertiesEncode (String text, boolean leadingSpacesOnly)
 

Required Arguments
 
String text The text to be encoded. Should be either a key name or a property value.

Optional Arguments
 
boolean leadingSpacesOnly If true, then only leading spaces are encode (by adding a \). The default is false. For property value names, readability may be improved by specifying true(). Note that property key names containing spaces should not be encoded with leadSpacesOnly set to true.

Example
 
propertiesEncode(" a whole bunch of spaces ")

returns the string "\ a\ whole\ bunch\ of\ spaces\ "

propertiesEncode(" a whole bunch of spaces ", true())

returns the string "\ a whole bunch of spaces "


© Copyright IBM Corporation 2008. All Rights Reserved.