Last active
June 22, 2017 21:44
-
-
Save jakauppila/8b00a82aa19dc6506b2fde2a1c9ba5c7 to your computer and use it in GitHub Desktop.
Groovy String Interpolation Evaluation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This value is being read in from an external file, which is why we can't perform the interpolation at runtime | |
myString = 'https://${first}:${second}@foobar.com' | |
// These are the two variables I want to substitute | |
first = 'hello' | |
second = 'world' | |
println evaluate(/"$myString"/) | |
// Expected | |
// 'https://hello:world@foobar.com' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment