I have a String that represents an integer value and would like to convert it to an int. Is there a groovy equivalent of Java\'s Integer.pars
String
int
Integer.pars
Here is the an other way. if you don't like exceptions.
def strnumber = "100" def intValue = strnumber.isInteger() ? (strnumber as int) : null