Remove All Commas from a JavaScript string (JavaScript)

 



Let’s Consider,

var userInput = I,Love,Java,Script;
userInput.replace(/,/g , “”);

alert(userInput );

OUTPUT : ILoveJavaScript

Leave a Reply