ExpandEnvVar function

Syntax

ExpandEnvVar(string)

Description

Use the ExpandEnvVar function to convert any environment variables that it finds within string into String values and returns the entire resulting string.

Parameters

Parameter Description

string

A string containing an environment variable.

Returns

Returns a string equal to string with any enclosed environment variables expanded to their values.

Example

Assume that the environment variable %NETDRIVE% is equal to "N:". The following PeopleCode sets &newstring equal to "The network drive is equal to N:":

&newstring = ExpandEnvVar("The network drive is equal to %netdrive%.");