How to remove comma from string in jquery with example ?

By Hardik Savani | August 27, 2016 | Category : Javascript HTML jQuery

Sometimes, we require to remove comma, semicolon, colon etc from string in your jquery code At that time you can simply remove comma using js replace(). Jquery replace() through we can replace comma into empty string that way comma will be remove from jquery string.

In this example you can see how it works. It small thing but helpful because this you can also delete semicolon ,colon ,dot etc. So, let's try bellow example and see..


<html lang="en">


<title>Jquery remove comma from string</title>

<script src=""></script>



<script type="text/javascript">

$(document).ready(function() {

var myStr = "Hi, Hardik. How are you?";

myStr = myStr.replace(/,/g, "");






Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.

We are Recommending you: