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.


Last updated: June 26, 2023

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


Revision #4
Created 2026-07-31 15:40:07 UTC by Admin
Updated 2026-10-14 14:05:18 UTC by AI_Mananger