Struggling with replacing some html-element in a string

0
Hi , I have a string in $Object/Plaintext = '...ondersteunen van slimmer ...' I want to replace '&bsp;' with one space and try this as a change object on the attribute: replaceAll($Object/PlainText, ' ' ,' ') this doesn't work? why? and how could i change it then?
asked
3 answers
1

If you look at the documentation, it needs a regular expression. Does '\u00a0' work?

answered
1

Perhaps something like the following?

//escape:
var entityMap = {
    "&": "&",
    "<": "&lt;",
    ">": "&gt;",
    '"': '&quot;',
    "'": '&#39;',
    "/": '&#x2F;'
  };
function escapeHtml(string) {
    return String(string).replace(
        /[&<>"'\/]/g,
        function (s) {
            return entityMap[s];
        }
    );
}
console.log(escapeHtml("1 & 2"));

//unescape
function decodeEntities(encodedString) {
    var textArea = document.createElement('textarea');
    textArea.innerHTML = encodedString;
    return textArea.value;
}
console.log(decodeEntities('1 &amp; 2')); // '1 & 2'
answered
0

Actually I discovered a Before commit on the object which overwrited the change. Initial expression of me works.

answered