If I echo a string like this:
let s = "Hello\nworld"
echo s
I get:
Hello
world
I would like to output:
Hello\nworld
I know I can use raw string literals if I'm defining the string, but how do i do it if the string comes from, for example, a file?
I guess I'm looking for something similar to pythons repr()
function.
edit: There is a repr function for Nim. However, the output is not what i'm looking for:
let hello = "hello\nworld"
echo repr(hello)
---- Output ----
0x7fc69120b058"hello\10"
"world"