javascript remove spaces from text and character code example Example: remove spaces in a string js str.replace(/\s+/g, '')