Groovy web console

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

switch_validation

Published 9 months ago by not_applicable with tags switch case
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def new_prefix = ""
def old_prefix = "none"
switch( "none" )
{
    case "none":
        new_prefix = ""
    default:
        new_prefix = old_prefix+"_"
}
return[Formatted_Prefix:new_prefix]