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 :: ngstyle background url angular 
Javascript :: include other js files in a js file 
Javascript :: how to prevent event capturing in javascript 
Javascript :: es6 iife 
Javascript :: jquery div show 
Javascript :: how to add new key value to json object in javascript 
Javascript :: javascript json append array 
Javascript :: PayloadTooLargeError 
Javascript :: genius lyrics api 
Javascript :: javascript password hashing 
Javascript :: dynamic route vue 
Javascript :: javascript urlsearchparams to string 
Javascript :: js host without port 
Javascript :: fetch function javascript 
Javascript :: saving text in javascript 
Javascript :: javascript redirect to url with parameters 
Javascript :: redirect in vue 
Javascript :: find last element in array nodejs 
Javascript :: simple kick command discord.js v12 
Javascript :: firebase timestamp to date angular 
Javascript :: how to get element by id in node js 
Javascript :: js script 
Javascript :: chalk js 
Javascript :: how to change background color though props 
Javascript :: read xlsx file in angular 5 
Javascript :: Update multiple documents by id set. Mongoose 
Javascript :: local database with javascript 
Javascript :: round decimal js 
Javascript :: This version of CLI is only compatible with Angular versions 
Javascript :: check how many files in a folder js 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =