How do you add "\n" to a label, NOT a new line

App inventor treats \n as a new line, which is usually convenient. However, I want the label to literally say for instance "test(test\n)" and not
"test(test
)"

How do I get app inventor to NOT treat \n in a label as a newline

Try another \ as escape character
test(test\\n)

Taifun

I actually tried that because that's how c++ does it, but instead I get

"test(test\
)"

Tick the html content check box in the designer for the label, then replace \n with html entities:

image

for @ABG's better approach:

image

image

To defuse the \n bomb, break it into two parts in separate text blocks and JOIN them.
image

1 Like

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.