Answers for "javascript strip certain chars"

2

remove all characters from string javascript

const string = "hello world 123";

// remove all o's from the string
string.replace(/o/g, "") // "hell wrld 123"

// remove all letters from the string
string.replace(/[A-Za-z]/g, "") // "  123"

// remove all digits from the string
string.replace(/\d/g, "") // "hello world "
Posted by: Guest on May-30-2021
0

remover ultimo character string javascript

var texto = $("#input_id").val();
$("#input_id").val(texto.substring(0, texto.length - 1));
Posted by: Guest on September-28-2020

Code answers related to "javascript strip certain chars"

Code answers related to "Javascript"

Browse Popular Code Answers by Language