Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

replace all commas in string javascript

string.replace(/,/g, '-');
Comment

how to replace commas with nothing in javascript

var myStr = 'this,is,a,test';
var newStr = myStr.replace(/,/g, '');

console.log( newStr );  // "this-is-a-test"
Comment

PREVIOUS NEXT
Code Example
Javascript :: js remove space before string 
Javascript :: remove blank space javascript 
Javascript :: js push into array if item exist 
Javascript :: how to set text for label in jquery 
Javascript :: edit onclick event 
Javascript :: react native get route name 
Javascript :: js check if string is base64 
Javascript :: js upload json 
Javascript :: jest mock react router params 
Javascript :: nodejs require everything without prefix 
Javascript :: fakepath 
Javascript :: js get difference in days 
Javascript :: js date year 
Javascript :: datatable columns with nullable fields ajax 
Javascript :: expo ignore warnings 
Javascript :: clear canvas for redrawing 
Javascript :: email validation regex 
Javascript :: pass array of strings to match in str.replace 
Javascript :: jquery append after 
Javascript :: ngrok angular 8 
Javascript :: add a trailing slash javascript url 
Javascript :: getting data from firestore using async await 
Javascript :: references another schema in sequelize 
Javascript :: js iterate set 
Javascript :: javascript word start with 
Javascript :: vue small scroll 
Javascript :: find the key of a value in array js 
Javascript :: react native cache clear 
Javascript :: regex to check the phone number javascript 
Javascript :: How to know react and react-native version 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =