Forum Discussion

chathurad's avatar
chathurad
Contributor
6 years ago
Solved

How to validate the 1st character of a responce data set

In my resonce i have to check the responce text is starting with letter "D" Is there any way to do this.So far i have able to get the entire 1st responce,But my gall is to validate whether the 1st ...
  • chathurad's avatar
    6 years ago

    I was able to do this by:

    def slurper = new JsonSlurper()
    def json = slurper.parseText response
    String countryList = json.result.values[0]
    def aa =countryList.take(1)