Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extract value from String

 
Isaac Ferguson
Ranch Hand
Posts: 841
1
  • 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
  • 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: 4567
8
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic