# How to remove all extra spacing between words?

Text1.replace(/ {1,}/g," ")

The `g` at the end of the RegExp means: global, ie match and replace all occurrences.

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/P2pIVE7c1Z75X75n-fb2b98361f0b.png)<div id="bkmrk-last-updated%3A-june-2">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">June 26, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>