A
A
a000_000a2018-08-08 09:43:08
Java
a000_000a, 2018-08-08 09:43:08

How to parse a string in Groovy?

You need to parse a string like arg1-arg2:arg3/arg4-arg5:arg6-arg7-arg8. What is the best way to parse a string into arguments?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-08-08
@a000_000a

def s = 'arg1-arg2:arg3/arg4-arg5:arg6-arg7-arg8'
def tokens = s.tokenize('-:/')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question