Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to replace all characters in a string javascript

const string = "a, b, c, d, e, f";
string.replace(/,/g, '');
console.log(string) //a b c d e f 
Comment

js replace all char in string

"x".replaceAll("x", "xyz");
// xyz

"x".replaceAll("", "xyz");
// xyzxxyz

"aA".replaceAll("a", "b", true);
// bb

"Hello???".replaceAll("?", "!");
// Hello!!!
Comment

replace all character in string javascript

let a = "How to search and replace a char in a string";
while (a.search(" ", ""))
{
   a = a.replace(" ", "");
}
console.log(a);
Comment

PREVIOUS NEXT
Code Example
Javascript :: electron specify minimum size 
Javascript :: how to set height dynamically in jquery 
Javascript :: date constructor javascript 
Javascript :: node js random number generator 
Javascript :: adding font awesome to npm or react 
Javascript :: nodejs 16 install 
Javascript :: rxjs cdn 
Javascript :: mui theme remove shadow 
Javascript :: how to add youtube insta icon to next js 
Javascript :: query params vuejs 
Javascript :: javascript remove last character from string 
Javascript :: javascript loop through array 
Javascript :: $.ajax async false 
Javascript :: props.history.push with data 
Javascript :: npm install the exact package version specified in package.json 
Javascript :: two button in one row react native 
Javascript :: javascript clear symbols 
Javascript :: react copy to clipboard 
Javascript :: fs write stream append 
Javascript :: pyspark dataframe json string 
Javascript :: display block class javascript 
Javascript :: jquery minified cdn 
Javascript :: parsley cdn 
Javascript :: javascript init an array to 0 
Javascript :: leaflet change zoom button position 
Javascript :: width 100% react-native 
Javascript :: javascript with html 
Javascript :: jquery clear click event 
Javascript :: How to update node.js in replit 
Javascript :: How i can use “LIKE” operator in mongoose 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =