Skip to main content
lionelc0001
October 8, 2021
Solved

Carriage return in cleanwith() function

  • October 8, 2021
  • 4 replies
  • 0 views

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"

Best answer by joshl

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?

4 replies

stefanhelzle0001
Brainy
October 8, 2021
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().

lionelc0001
October 8, 2021

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:

"My texte with carriage

return"

instead of

"My texte with carriage return" or "My texte with carriagereturn"

joshl
joshlAnswer
October 8, 2021

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?