'Spring environment variable values computing

Can I somehow use environment variable to set a properties value, but using computing, something like this:

test2: ${TEST+1:2} 
test: ${TEST:1}

As you can see the default values are 1 and 2 and I want the same if it's being set from environment variable. I want to do this in my application.properties/application.yml file, not in code.



Solution 1:[1]

There's System.getEnv from the Java Standart Library to get Env Variables.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 GabeRAMturn