Example:
// Expands ~ to home directory
auto home = filenameExpand("~");
assert(home.length > 0);
assert(home[0] == '/');string filenameExpand(string path) @trustedExpands environment variables and tilde in a filename.
Replaces `~` with the user's home directory and expands environment variables in the form $VAR or ${VAR}.
path | Path containing variables to expand |
Example:
// Expands ~ to home directory
auto home = filenameExpand("~");
assert(home.length > 0);
assert(home[0] == '/');