Forum Discussion

mcbootus's avatar
mcbootus
Contributor
14 years ago

[Resolved] Groovy Parsing Question

Dear Support,

I have a simple parsing requirement which I cannot find a way to undertake! We have a response code which is ONLY two letters - for example "LV".

I need to parse this so that the first and second letter are split into two variables like "L" and "V" and stored in seperate properties locations.

What is the simplest way to split these two characters please.

Thank you in advance.

Armen
  • Hi Armen!

    Try this:
    myResponse = "LV"
    firstLetter = myResponse[0]
    secondLetter = myResponse[1]


    Regards!

    /Henrik
    eviware.com