When a line is displayed, a line break is displayed as \n.
However, if you try to print a line, you will see it as the correct line break:
- val x = "hello\nworld";
> val x = "hello\nworld" : string
- print x;
hello
world> val it = () : unit
It's just how a string is displayed, and you cannot force the SML interpreter to display it as an actual new string, except by printing it yourself.
source
share