Groovy web console

subscribe to the feed Subscribe
to this
site
isInterger (via #groovywebconsole)
tweet this snippet Tweet
this
script

isInterger

Published 3 months ago by Paul with tags isInterger interger
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def test = '42'.isNumber()
def test2 = '8080G'.isInteger()
def test3 = '8080G'.isInteger()
def test4 = '42'.isInteger()
def test5 = 'AAAAA42'.isInteger()
def port = 'AAA123'.isInteger()
def intValue = port ? port.toInteger() : null

println(test)
println(test2)
println(test3)
println(test4)
println(test5)
println(intValue)