Printing raw string stored in variable

Apologies, I made a mistake by saying my goal is to “print” the string. I’m writing a function which returns a string, that way the client of my library can print the string wherever they want, or send it to some other I/O mechanism. IO.inspect/1 prints to stdout and returns the string as-is, without escaping. I suppose alternatively, I could add a device argument which defaults to :stdio in favor of the stdlib’s IO.inspect function, and then instead of returning a string I could have my function call IO.inspect/2 and pass the device argument to it.