0

Hi I'm trying to get information from a huge string, the thing is that I need to extract some words after a tag. I think this example will explain it better. I send a code to a web page and it returns me a String like this:

String CodeISend= "JFK";
//The process of getting the returned String isn't important right now

String returnedCode="{"airport":{"fs":"JFK","iata":"JFK","icao":"KJFK","faa":"JFK","name":"John F. Kennedy International Airport","street1":"JFK Airport","city":"New York"" 

I need to extract the name of the airport and save it into a separate String. But I really don't know how to get the info after "name": Appreciate the help!

user3487815
  • 15
  • 1
  • 5

1 Answers1

0

You want to convert this from json into a map and lookup your airport using "name" as a key: map.get(key)

See this discussion: Convert Json to Map

and here to learn more about maps: http://docs.oracle.com/javase/tutorial/collections/interfaces/map.html

Community
  • 1
  • 1
kurofune
  • 1,055
  • 12
  • 26