class StringUtil {

    public static String substituteWithEnvironment(String string0) throws SubstitutionException {
        // turn environment into properties
        Properties envProps = new Properties();
        // add all system environment vars to the properties
        envProps.putAll(System.getenv());
        // delegate to other method using the default syntax $ENV{<key>}
        return substituteWithProperties(string0, "$ENV{", "}", envProps);
    }

}