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