You can use the method replacefor a string object. Here's what W3Schools says about it: JavaScript replace () .
In your case, you can do something like the following:
str = str.replace(";", "");
You can also use regex:
str = str.replace(/;/g, "");
This will replace all semicolons globally. If you want to replace only the first instance, you will remove gfrom the first parameter.
source
share