Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 2 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class PR {
    String name
    void name(String name) {
        this.name = "$name"       
    }
    String Name() {
        this.name                       
    }
}

def p = new PR()
p.name = 'Revert "Port Vault Credential Management from On-prem (#1518)"'    
//a='Revert "Port Vault Credential Management from On-prem (#1518)"'
//println(a.replaceAll(/(!|"|@|#|\$|%|&|\\/|\(|\)|=|\?)/, /\\$0/))
//println(a)
a="""
xxx
${p.name.replaceAll(/(!|"|@|#|\$|%|&|\\/|\(|\)|=|\?)/, /\\$0/)}
yyy
"""
println(a)