Groovy web console

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

groovy overloading

Published 1 month ago by rp
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
Integer.metaClass.multiply = { String s -> 
    String result = ""; 
    for(int i = 0; i < delegate; ++i) { result += s }; 
    return result 
}
25 * 'e'