SyntaxFix
Write A Post
Hire A Developer
Questions
Here is the an other way. if you don't like exceptions.
def strnumber = "100" def intValue = strnumber.isInteger() ? (strnumber as int) : null