Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 "
 
PREVIOUS NEXT
Tagged: #remove #characters #string #javascript
ADD COMMENT
Topic
Name
1+3 =