Using "$" in Groovy

Viewed 98662

I see { } are used for closures, and then I believe when a $ is put in front of braces, it is simply doing a variable substitution within a string. I can't find the documentation on how the $ works in the reference ... hard to search on it unfortunately, and the Groovy String documentation is lacking in introducing this. Can you please point me to the documentation and/or explain the "$" operator in Groovy -- how all it can be used? Does Grails extend it at all beyond Groovy?

4 Answers

Work in side Jenkins File in pipeline enter image description here

#!/usr/bin/env groovy
node{
          stage ('print'){
             def DestPath="D\$\\"
             println("DestPath:${DestPath}")
          }
}
Related