xtd 0.2.0
Loading...
Searching...
No Matches

◆ expand_environment_variables()

static xtd::ustring xtd::environment::expand_environment_variables ( const xtd::ustring name)
static

Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string.

Parameters
nameA string containing the names of zero or more environment variables. Each environment variable is quoted with the percent sign character (%).
Returns
A string with each environment variable replaced by its value.
Remarks
Replacement only occurs for environment variables that are set. For example, suppose name is "MyENV = %MyENV%". If the environment variable, MyENV, is set to 42, this method returns "MyENV = 42". If MyENV is not set, no change occurs; this method returns "MyENV = %MyENV%".