Given a string in Kotlin, how can I print it in what would be a string literal format?
Or in longer form, given some method named foo that does this, it would do the following:
println("Howdy".foo()) --> "Howdy" (quotes included in the output)
println("1 line\n\tand a tab".foo()) --> "1 line\n\tand a tab"
println("\"embeded quotes\"".foo()) --> "\"embeded quotes\""
Basically I'm trying to create debug output that matches the code form of the string. toString
just returns the string, not the dressing/escaping to recreate it in code.