[前][次][番号順一覧][スレッド一覧]

ruby-changes:54690

From: kazu <ko1@a...>
Date: Tue, 22 Jan 2019 21:44:03 +0900 (JST)
Subject: [ruby-changes:54690] kazu:r66906 (trunk): Add more example of `String#dump`

kazu	2019-01-22 21:43:57 +0900 (Tue, 22 Jan 2019)

  New Revision: 66906

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66906

  Log:
    Add more example of `String#dump`

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 66905)
+++ string.c	(revision 66906)
@@ -6002,12 +6002,13 @@ rb_str_inspect(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L6002
  *     str.dump   -> new_str
  *
  *  Produces a quoted version of +str+ with all non-printing characters replaced
- *  by <code>\xnn</code> notation and all special characters escaped.
+ *  by <code>\xHH</code> notation and all special characters escaped.
  *
  *  This method can be used for round-trip: if the resulting +new_str+ is
  *  eval'ed, it will produce the original string.
  *
- *    "hello \n ''".dump  #=> "\"hello \\n ''\""
+ *    "hello \n ''".dump     #=> "\"hello \\n ''\""
+ *    "\f\x00\xff\\\"".dump  #=> "\"\\f\\x00\\xFF\\\\\\\"\""
  */
 
 VALUE

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]