xtd 0.2.0
environment_expand_environment_variables.cpp

Shows how to use xtd::environment::expand_environment_variables method.

#include <xtd/console>
#include <xtd/environment>
using namespace xtd;
auto main() -> int {
auto str = string::empty_string;
auto nl = environment::new_line();
// <-- Keep this information secure! -->
auto query = "My system drive is %SystemDrive% and my system root is %SystemRoot%";
console::write_line("expand_environment_variables: {0} {1}", nl, str);
}
// This code produces the following output :
//
// expand_environment_variables:
// My system drive is C: and my system root is C:\windows
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
static xtd::string expand_environment_variables(const xtd::string &name)
Replaces the name of each environment variable embedded in the specified string with the string equiv...
@ query
The xtd::uri::query data.
Definition uri_components.hpp:29
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8