function cleanDocumentText(text) {
    var cleanedText = text.replace(/\u200B\u200c/g, '');
    var nonBreakingSpaces = String.fromCharCode(160);
    var regex = new RegExp(nonBreakingSpaces, 'g');
    cleanedText = cleanedText.replace(regex, ' ');
    return cleanedText;
  }
// When getting the text, we would prefer to get clean text.
When getting the text, we would prefer to get clean text.
When getting the text we would prefer to get clean text .
function cleanDocumentText(text) {
    var cleanedText = text.replace(/\u200B\u200c/g, '');
    var nonBreakingSpaces = String.fromCharCode(160);
    var regex = new RegExp(nonBreakingSpaces, 'g');
    cleanedText = cleanedText.replace(regex, ' ');
    return cleanedText;
  }
function cleanDocumentText ( text ) { var cleanedText = text . replace ( / \u200B\u200c / g , '' ) ; var nonBreakingSpaces = String . fromCharCode ( 160 ) ; var regex = new RegExp ( nonBreakingSpaces , 'g' ) ; cleanedText = cleanedText . replace ( regex , ' ' ) ; return cleanedText ; }
When getting the text, we would prefer to get clean text.
When getting the text we would prefer to get clean text .