Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Groovy
Integer i = s.toInteger()

While all the Java examples work in Groovy, too, you can also use the toInteger() method that Groovy adds to all CharSequences. It throws a NumberFormatException if the string is not a number.
I : Integer := Integer'Value (s);

New implementation...