File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Extract value from String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Extract value from String" Watch "Extract value from String" New topic
Author

Extract value from String

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 331
Hi I have make a request to the server and I have got the next answer



Now from my code I need extract the value of the access_token, I have this code:



where res is a string with the data. What way could I have only the access_token?

Many Thanks
R. Jain
Ranch Hand

Joined: Aug 11, 2012
Posts: 370
    
    1

Angus Ferguson wrote:What way could I have only the access_token?
Many Thanks

You can use split method of String class. That would be helpful..
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

Is that response JSON? It looks like it. If it is, the easiest way of parsing it is going to be to use a JSON library.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extract value from String
 
Similar Threads
RestFB Insights question
Sending http request
commons fileupload mutlipart/data-form, extracting values from the checkboxes
Sending http request
A 404 Error, need help configuring web.xml