JSFiddle - React, Tailwind, and code Playground JavaScript var temp = "^hall^,^restaurant^"; temp = temp.replace(/\^/g, ''); console.log(temp);