Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

remove commas from string javascript

var stringWithCommas = 'a,b,c,d';
var stringWithoutCommas = stringWithCommas.replace(/,/g, '');
console.log(stringWithoutCommas);
Comment

remove commas from string javascript

var purpose = "I, Just, want, a, quick, answer!";

// Removing the first occurrence of a comma
var result = purpose.replace(",", "");

// Removing all the commas
var result = purpose.replace(/,/g, "");
Comment

javascript remove multiple commas from string

/[,s]+|[,s]+/g

var str= "your string here";
//this will be new string after replace
str = str.replace(/[,s]+|[,s]+/g, 'your string here');
Comment

PREVIOUS NEXT
Code Example
Javascript :: node js sleep between axios 
Javascript :: mongoose deprecation warning 
Javascript :: video mute and unmute 
Javascript :: javascript for loop array backwards 
Javascript :: js UTC to local timezone 
Javascript :: javascript print array 
Javascript :: variable used in a function can be used in another function js 
Javascript :: how to display image from s3 bucket in react js 
Javascript :: how to add new row in table on button click in javascript with next number 
Javascript :: js cheat sheet 
Javascript :: javascript regex exact match 
Javascript :: chai test throw error 
Javascript :: get element by name in jquery 
Javascript :: jspdf create table 
Javascript :: js remove key from object 
Javascript :: js hover event 
Javascript :: p5js click on button 
Javascript :: queryselectorall example 
Javascript :: execcommand js 
Javascript :: check if the element exists in javascript 
Javascript :: trigger a function inside child from parent vue 
Javascript :: json stands for 
Javascript :: onclick arrow function javascript 
Javascript :: creating a module with lazy loading in angular 9 
Javascript :: js push array into array 
Javascript :: lodash clonedeep 
Javascript :: xlsx to json using xlsx react 
Javascript :: var x = 
Javascript :: for of mdn 
Javascript :: how to add a white space in jsx 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =