GetPropertyString()

edit

Gets the value of a property entry from a properties file.

Introduced: 7.0.0.108

GetPropertyString( filePath=string, key=string, encoding=string );

Returns: String

Argument Description Default
filePath
string, required
edit

Path of the properties file

key
string, required
edit

Name of the key to return

encoding
string, optional
edit

Encoding for the properties file

UTF-8

Examples

edit
// Define the path to your properties file
path = expandPath("/path/to/your/test.properties");

// Retrieve the value of the 'lucee' property using UTF-8 encoding propertyValue = getPropertyString(path, "lucee", "UTF-8");
// Output the property value writeDump(propertyValue);

See also