how to remove last comma from string in jquery code example
Example 1: remove last comma from string javascript
str = str.replace(/,\s*$/, "");
Example 2: remove last character from string jquery
$(document).ready(function() {
var chrt = 'wlearnsmart';
alert("Delete last character here... - " + chrt.slice(0, -1));
});