Created
July 19, 2019 07:15
-
-
Save dove-young/89defad13d6365f81a86e52aabf2c28e to your computer and use it in GitHub Desktop.
String Map GStringImpl
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
| #!/usr/bin/groovy | |
| s = "something" | |
| t = "${s} else" | |
| println "${s}".getClass().name //org.codehaus.groovy.runtime.GStringImpl | |
| Map mm = ["${s}": "${t}"] | |
| println mm["${s}"].getClass().name //org.codehaus.groovy.runtime.NullObject | |
| println mm["${s}"] //null | |
| Map nn = ["something": "something else"] | |
| println nn[s].getClass().name //java.lang.String | |
| println nn[s] //something else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment