java - Using regular expressions to rename a string -


in java, want rename string ends ".mp4"

suppose have encoded link, looking follows:

string link = www.somehost.com/linkthatineed.mp4?e=13974etc...

so, how rename link string ends ".mp4"?

link = www.somehost.com/linkthatineed.mp4  <--- that's need final string be. 

another way split string ".mp4" split char , add again :)

something :

string splitchar = ".mp4"; string link = "www.somehost.com/linkthatineed.mp4?e=13974etcrezkhjk" string finalstr = link.split(splitchar)[0] + splitchar; 

easy ^^

ps: prefer pass regex ask more knowledge regex ^^


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

collision detection - C++ library for mesh to mesh intersection: what is available? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -