I am currently trying to split a string 1128-2 so that I can have two separate values. For example, value1: 1128 and value2: 2, so that I can then use each value se
1128-2
def (value1, value2) = '1128-2'.split('-') should work.
def (value1, value2) = '1128-2'.split('-')
Can anyone please try this in Groovy Console?
def (v, z) = '1128-2'.split('-') assert v == '1128' assert z == '2'