var ret = "data-123".replace('data-','');_x000D_
console.log(ret); //prints: 123
_x000D_
For all occurrences to be discarded use:
var ret = "data-123".replace(/data-/g,'');
PS: The replace function returns a new string and leaves the original string unchanged, so use the function return value after the replace() call.