cancel
Showing results for 
Search instead for 
Did you mean: 

How to get value of array elements starting with alphabets

Highlighted
Occasional Contributor

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.

 

 

 

1 REPLY 1
Highlighted
Staff

Re: How to get value of array elements starting with alphabets

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()


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Top Kudoed Authors