chickadee » fmt » slashified

(slashified <str> [<quote-ch> <esc-ch> <renamer>])procedure

Outputs the string <str>, escaping any quote or escape characters. If <esc-ch> is #f escapes only the <quote-ch> by doubling it, as in SQL strings and CSV values. If <renamer> is provided, it should be a procedure of one character which maps that character to its escape value, e.g. #\newline => #\n, or #f if there is no escape value.

(fmt #f (slashified "hi, "bob!""))

=> "hi, "bob!""