Ok I wasn't really sure how to word this question, but basically what I want to do is, I got a url from a RSS feed in android, and I need to put part of that url into a string, the url will look something like this: http://www.prsn.uprm.edu/Spanish/Informe_Sismo/myinfoGeneral.php?id=20161206012821
and I only want the part after id=, ONLY the number, is that possible? Please help me, Thanks
Asked
Active
Viewed 73 times
-1
-
1Check out the answers provided [here](http://stackoverflow.com/questions/13592236/parse-a-uri-string-into-name-value-collection) on how to parse a URI string – dymmeh Dec 09 '16 at 04:53
1 Answers
2
You can achieve this by using two ways:
// One Way
String url = "http://www.prsn.uprm.edu/Spanish/Informe_Sismo/myinfoGeneral.php?id=20161206012821";
String substr = "=";
String after = url.substring(url.indexOf(substr) + substr.length());
// Second Way
String[] parts = url.split(substr);
String afterTwo = parts[1];

Reena
- 1,368
- 1
- 11
- 25
-
Hi, I need to load the _after_ in this url`"http://shake.uprm.edu/~shake/archive/shake/"here"/download/tvmap.jpg"` how i can do this? – Efrain Junior Valentin Dec 09 '16 at 19:00
-
I need to load into Glide 'Glide.with(context).load(here).into(holder.Thumbnail);' – Efrain Junior Valentin Dec 09 '16 at 19:01