Interpolating environment variables in string
问题 I need to expand environment variables in a string. For example, when parsing a config file, I want to be able to read this... statsFile=${APP_LOG_DIR}/app.stats And get a value of "/logs/myapp/app.stats", where the environment variable APP_LOG_DIR = "/logs/myapp". This seems like a very common need, and things like the Logback framework do this for their own config files, but I have not found a canonical way of doing this for my own config files. Notes: This is not a duplicate of the many