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