Groovy web console

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

Domain

Published 2 months ago by Msidelnik
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def url = "http://www.bla.com.ar"

String cleanUrl = url.replaceFirst("^(http|https)://", "")
String domain = cleanUrl.substring(0, cleanUrl.indexOf("/"))
println domain