cut a string js code example Example: cut string from string javascript var ret = "data-123".replace('data-',''); console.log(ret); //prints: 123