js remove string from string
snippet in php

How to remove text from a string in javscript

user698

var ret = "data-123".replace('data-','');
console.log(ret);   //prints: 123

javascript remove text from string

user201

var str = "That is like so not cool, I was like totally mad.";
var cleanStr = str.replace(/like/g, "");//replace every "like" with blank ""

remove substring from string javascript

user5970

var ret = "data-123".replace('data-','');

js remove string from string

user9738

var ret = "data-123".replace('data-','');
console.log(ret);   //prints: 123