I'm trying to display all the ascii characters using the following code in Groovy:
Code:
def x = 0
while (x++ < 255)
{
println "$x=\$x"
}
output:
Code:
1=$x 2=$x 3=$x 4=$x 5=$x 6=$x 7=$x 8=$x 9=$x 10=$x
I would like to escape the variable that way I don't have to write out this:
Code:
println "1=\01"
println "2=\02"
println "3=\03"
println "4=\04"
println "5=\05"
...
is there a way to make this work?
This is the output I would like: