_ivanovich_
5 years agoFrequent Contributor
How to convert array to intger with groovy ?
Hi,
i have a json response where there is a value like :
slurperresponse.data.debt[0].totalValue = [50]
if i assert like this:
assert slurperresponse.data.debt[0].totalValue = 50
it doesn't accept because [50] is not int
How can i convert [50] into 50 ?
Thank you
Found solution with this:
int b = a.collect { "$it" }.join( '' ) as int
Sorry for spam.