File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extract value from String

 
Isaac Ferguson
Ranch Hand
Posts: 831
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 375
1
Java Python Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic