String Manipulation ReplaceChars Bug?


 I would like to replace the following characters with a space: /,;?!\   in all text written in a column

If you write in a Table Creator in the column Freetext the text

aaa\bbb C,D

and you use a string manipulation node writing

replaceChars($Freetext$, "/,;?!\\", " ")


As result I would expect

aaa bbb C D

but I get

aaabbb CD

without the space between aaa and bbb and betweeen C and D


How come? Is this a bug? How I can solve this?

Thanks in advance



The behaviour is correct. If you study the documentation for the replaceChars function carefully, you will notice that for every single character in the "chars" arguments there is one dedicated character in the "replace" argument. If you specify only a single space in the "replace" argument this means that the first character in "chars" will be replaced by a space and every other character by an empty character (i.e. it will be removed). If you want to replace every character with a space you need to pass as many spaces in the "replace" argument as there are characters .

Many thanks Thor. It works well. Do you know if there is a way with replaceChars to replace all this chars /,;?!\ with a combinations of 3 chars (i.e. £$#) in stead of a single space, but without using multiple nested replaceChars ?

Thanks in advance!