Answers for "remove unwant element in string js"

24

How to remove text from a string in javscript

var ret = "data-123".replace('data-','');
console.log(ret);   //prints: 123
Posted by: Guest on March-25-2020
0

how to delete a letter from a string in javascript

substr() – removes a character from a particular index in the String.
replace() – replaces a specific character/string with another character/string.
slice() – extracts parts of a string between the given parameters.
Posted by: Guest on January-28-2022

Code answers related to "remove unwant element in string js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language