Is there a way to authorize the carriage return when using the cleanwith() function?
I tried to include char(10) or char(13) at the end of the "with" parameter, but the result is not what I expected.
Examples:
ri!myText:
"My texte with carriage
return"
cleanwith(ri!myText,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "&char(10))
Result > "My texte with carriage return"
cleanwith(ri!myText,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "&char(13))
Result > "My texte with carriagereturn"
Discussion posts and replies are publicly visible
Lionel Chatagny said:I tried to include char(10) or char(13) at the end of the "with" parameter, but the result is not what I expected.
What is the expected behaviour?
If you want to replace these characters with a space, then use substitute().
Hi Stefan,
I expect to keep all the characters of my parameter "with" including the carriage return.
In my example I would like this output:
instead of
"My texte with carriage return" or "My texte with carriagereturn"
When I paste your snippet in a new rule, I do see the carriage return being removed in the "Formatted" view of the test output, but when I Switch to "Raw", it looks like your expectations. Have you seen an issue in your systems or was the output view the "trip-up" point?
Thanks for pointing the difference between "Formatted" and "Raw". It was indeed what disturbed me in the first place.
I was focused on the test of my rule and I forgot to replace it in its context, now it works perfectly fine.
Thank you