JSFiddle - React, Tailwind, and code Playground JavaScript var mystring = "this,is,a,test"; mystring = mystring.replace(/,/g, "$"); alert(mystring);