genzou #6504(2008/06/14 23:28 GMT) [ Groovy ] Rating0/0=0.00
ひねりなしです。
1 2 3 4 5
def replaceNumber( text ){ text.replaceAll( /[1-9]\d+/, { (it.toInteger() * 1.05).toInteger() }) }
Rating0/0=0.00-0+
1 reply [ reply ]
genzou #8284(2009/01/04 21:32 GMT) [ Groovy ] Rating0/0=0.00
普通はこうやってreplaceAll使うらしい
def replaceNumber( text ){ text.replaceAll(/[1-9]\d*/){ (it.toInteger() * 1.05).toInteger() } }
[ reply ]
genzou
#6504()
[
Groovy
]
Rating0/0=0.00
ひねりなしです。
def replaceNumber( text ){ text.replaceAll( /[1-9]\d+/, { (it.toInteger() * 1.05).toInteger() }) }Rating0/0=0.00-0+
1 reply [ reply ]