Expands all the environment variable references in the given string with the value of the environment variable.
- name
- The string containing 0 or more environment variable references (like %HOME%).
Documentation for this section has not yet been entered.
In the given string parameter, the reference to the environment variable is written in Windows style, e.g.%HOME%
Note that the expansion only takes place if the environment variable is set. If it's not set, the reference is printed as is.printsC# Example
using System; class SystemDemo { public static void Main(string[] args) { Console.WriteLine(Environment.ExpandEnvironmentVariables("This app is running under the display %DISPLAY%")); } }This app is running under the display :0.0
when running on the :0 display on Linux.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0