I have a TextBox component in an interactive automation script displaying a piece of text from a dataset that can contain NewLines (\r\n).
I want the user to edit this text, and when he does, the content (.Text) of the textbox seems to have lost the NewLines: when I print it in an info message I don't see \r\n anymore.
Does this component replaces NewLines with something else?
hi Mieke
You're correct that the newline characters can differ depending on where the interactive automation script is executed. When running in web, the textbox will use '\n', while Cube uses '\r\n'. It is possible to mix both types in the initial value when a multiline initial value.
To easily split the text into lines, you can use something like:
var lines = textBoxStringValue?
.Split('\n')
.Select(x => x.Trim('\r'));
After processing, joining the lines using '\n' should work consistently across both environments.