Hi!

I would like to print a string in the same format that I would write it in the code (with quotes and with special characters escaped). Similar to [Go's %q format](https://pkg.go.dev/fmt#hdr-Printing). Is there a safe, built-in way to do that?

For example:

```
string s = "one \"two\"\nthree four";
writeln(/* ??? */);
```

And get as output

```
"one \"two\"\nthree four"
```

Instead of

```
one "two"
three four
```

Reply via email to