How to escape a character in a string in business central AL

1.1k views Asked by At

I keep coming across situations where i need to escape a character such as a quote. I never been able to figure out how to do this since a simple Message('test \' test'); doesn't work.

Every time i need to figure out a workaround, and its starting to bother me. Is there a way to do this or is it simply impossible?

1

There are 1 answers

1
Alexander Drogin On BEST ANSWER

It's a double quote mark in AL:

Message('test '' test');

Two consequent quote marks are interpreted as a single escaped quote. If you have a longer sequence, the same rule applies. Message('''''Test'''''); will display the text with two quote marks on each side.