method

inspect

v2_2_9 - Show latest stable - Class: String
inspect()
public

Returns a printable version of str, surrounded by quote marks, with special characters escaped.

str = "hello"
str[3] = "\b"
str.inspect       #=> "\"hel\\bo\""