Reading the address bar and change a var

I want to read the link on the address bar and change a var then put that as a link on a button.

Something like this

link: http://www.domain.net/site/index.php?task=1&lang=el

to

http://www.domain.net/site/index.php?task=1&lang=e
then put it in navigateToURL as a URLRequest.
Is this possible?