Path.expandVars
Path expandVars() constExpands environment variables in the path string.
Supported patterns:
- POSIX (all platforms):
$VARand${VAR}expand to the value ofVAR.
If the variable is not defined, the reference is left unchanged.
- Windows (in addition to
$VAR/${VAR}): also expands%VAR%.
Notes:
- Empty variables expand to an empty string.
- Braced form
${VAR}takes precedence when both styles are present. - This function does not interpret quotes or escapes; it only performs textual expansion.
Returns
A new Path with environment variables expanded.