replace javascript code example Example: replace javascript var cleanText = text.replace(/\xA0/g,' ');