I would like to substitute %s
with the value
<server>
<id>artifactory</id>
<username>%s</username>
<password>%s</password>
</server>
Is there any myString.format("name", "pass")
method in groovy?
groovy based on java and in java there is a format
method in String
class
so this should work
def s='''<server>
<id>artifactory</id>
<username>%s</username>
<password>%s</password>
</server>'''
println String.format(s, "name", "pass")