[DOC] Docs for String#dump

This commit is contained in:
Peter Zhu 2025-07-21 16:09:28 -04:00
parent 3bbdcf0848
commit 21c78cb0f7
2 changed files with 54 additions and 9 deletions

View file

@ -7413,16 +7413,9 @@ rb_str_inspect(VALUE str)
/*
* call-seq:
* dump -> string
* dump -> new_string
*
* Returns a printable version of +self+, enclosed in double-quotes,
* with special characters escaped, and with non-printing characters
* replaced by hexadecimal notation:
*
* "hello \n ''".dump # => "\"hello \\n ''\""
* "\f\x00\xff\\\"".dump # => "\"\\f\\x00\\xFF\\\\\\\"\""
*
* Related: String#undump (inverse of String#dump).
* :include: doc/string/dump.rdoc
*
*/