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

◆ get_environment_variable() [1/2]

static xtd::string xtd::environment::get_environment_variable ( const xtd::string variable)
static

Retrieves the value of an environment variable from the current process.

Parameters
variableThe name of the environment variable.
Returns
xtd::string The value of the environment variable specified by variable, or empty "" if the environment variable is not found.
Remarks
The get_environment_variable(xtd::string) method retrieves an environment variable from the environment block of the current process only. It is equivalent to calling the xtd::environment::get_environment_variable(xtd::string, xtd::environment_variable_target) method with a target value of xtd::environment_variable_target::process.
To retrieve all environment variables along with their values, call the xtd::environment::get_environment_variables method.
Environment variable names are case-sensitive on Linux and macOS but are not case-sensitive on Windows.