Q:

Removing the hash in my anchors

I'm using this piece of code to display the index value of my cycle slides at the end of the current URL. 
 var index = 0, hash = window.location.hash;
        if (hash) {
            index = /\d+/.exec(hash)[0];
            index = (parseInt(index) || 1) - 1; // slides are zero-based
        }

I would like to remove the '#' before the value.  How should I modify this code? 

A:

So you are trying to remove a hash from a string:
hash.replace(/#/, '')

var hash = "url.com/#3"
document.getElementById("newUrl").innerHTML = hash.replace(/#/, '');
<div id="newUrl"></div>

@SmokeyPHP below makes the point that I used regex to do this but you could equally give replace a string parameter: hash.replace('#', '')

