• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parsing URL parameter  RSS feed

 
Josh Reev
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have URL like this:

http://www.site.com/app/index.html#secret_code=gagh362%%23atg._f46&other=5449

I need to pass gagh362%%23atg._f46 part to a string. All the examples i find are for simple PHP parameter parsing and i'm having difficulties to adapt them to this case. Can someone help?
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


You should be able to figure out the rest.
 
Josh Reev
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry i forgot to mention that the URL address is being handled as String in my app. The code you gave returns
secret_code=gagh362%%23atg._f46&other=5449
can you tell me what functions should i use to remove the useless parts from that?
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The structure (roughly) is key=value&anotherKey=anotherValue. Knowing that and looking at the methods of the String class you can create a workable solution.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!