I have the following line:
oauth_token=safcanhpyuqu96vfhn4w6p9x&**oauth_token_secret=hVhzHVVMHySB**&application_name=Application_Name&login_url=https%3A%2F%2Fapi-user.netflix.com%2Foauth%2Flogin%3Foauth_token%3Dsafcanhpyuqu96vfhn4w6p9x
I am trying to parse the value for oauth_token_secret. I need everything from the equal sign (=) to the next ampersand (&). So I need to parse: hVhzHVVMHySB
I currently have the following code:
Const.OAUTH_TOKEN_SECRET = "oauth_token_secret";
Const.tokenSecret =
content.substring(content.indexOf((Const.OAUTH_TOKEN_SECRET + "="))
+ (Const.OAUTH_TOKEN_SECRET + "=").length(),
content.length());
It will start from the beginning of oauth_token_string, but it will not stop at the next ampersand. I'm not sure how to point to a stop at the end of the next ampersand. Can anybody help me?
source
share