JavaScript 2025 · Strings
Replace every occurrence
Replace all matches, not just the first.
const clean = text.replaceAll("-", " ");
Official JavaScript 2025 documentation
JavaScript 2025 · Strings
Replace all matches, not just the first.
const clean = text.replaceAll("-", " ");
Official JavaScript 2025 documentation
Was this page helpful?