Performs variable substitution in string value from the values of keys found in props.
The result of the substitutions.
The variable substitution delimiters are ${ and }.
For example, if props contains key=value
, then the call
[C#]
string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
will set the variable s
to "Value of key is value.".
If no value could be found for the specified key, then substitution defaults to an empty string.
For example, if system properties contains no value for the key "nonExistentKey", then the call
[C#]
string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
will set s to "Value of nonExistentKey is []".
An Exception is thrown if value contains a start delimiter "${" which is not balanced by a stop delimiter "}".
OptionConverter Class | log4net.Util Namespace