_satellite.cleanText
This function would trim leading and trailing whitespace from the string and replace any internal repeating whitespace characters with a single space " ".
Remedies:
1) For Data Elements in Launch, just check the Clean Text box on the configuration view.
2) If a function is needed, use the following:
1
//Adapted from https://github.com/adobe/reactor-turbine/blob/master/src/cleanText.js
2
function cleanText(str) {
3
return typeof str === 'string' ? str.replace(/\s+/g, ' ').trim() : str;
4
};
5
Copied!
Last modified 2yr ago
Copy link