How to eliminate the desired character & all the other characters succeeding that desired character.
def str1 = "value_of_string*123456"
"*"
"123456"
str1
"value_of_string"
def str1 = "value_of_string*123456"
assert str1.takeWhile { it != '*' } == 'value_of_string'
assert str1.tokenize('*')[0] == 'value_of_string'
assert str1.split("\\*")[0] == 'value_of_string'