<script>
str="http://localhost/a.aspx?pk1=0001&pk2=001245&pk3=userid";
newstr="";
strarr=str.split("&");
for(i=0;i<strarr.length-1;i++)
newstr+=strarr[i]+"#";
newstr+=strarr[i];
alert(newstr);
</script>