is there a template string where I can do something like {"foo": "bar"}
rather than "{\"foo\":\"bar\"}"
You can do a multiline string to avoid needing the escapes
multiline_str =
"""
{"foo": "bar"}
"""
But we don't have template strings like in JS, especially the feature where you can call a function on the string
But you can do interpolation on single line strings as well as multiline strings with
multiline_str =
"""
{ "foo": ${Inspect.to_str(bar)} }
"""
Last updated: Jul 26 2025 at 12:14 UTC