How to get value of array elements starting with alphabets
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2016
12:22 AM
06-11-2016
12:22 AM
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2016
09:54 AM
06-13-2016
09:54 AM
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. ⬇️⬇️⬇️
