Forum Discussion

Tek_Travels_Pvt's avatar
Tek_Travels_Pvt
Occasional Contributor
9 years ago

How to get value of array elements starting with alphabets

Hi Team,

 

I am using Ready API and using Data Gen to get value from an array created in same data gen. I am not able to retrieve elements from array starting with alphabets while the same is working for the elements starting with numbers. Below is the screens for both. Please provide the solution.

 

 

 

  • Try this,

    By default properties convert to String. so you need to reconvert them to array and retrieve values

    def airlineCode = context.expand( '${AirlineCode#AirlineCode}' )

    codes= airlineCode.replaceAll("\\[","").replaceAll("]","").split(",")

    return codes[0].toString()