1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

string.c (rb_str_format_m): Fix the example code of the doc

Change `%08x` to `%016x` because of two reasons:

* `%016x` demonstrates that we can use two or more digits here.
* Currently, many people uses 64-bit environment.
  (I'm unsure if object_id is a good example here, though...)
I'm unsure if

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2018-01-29 08:40:22 +00:00
parent 3bc2f5a9b6
commit 552a5a993c

View file

@ -1988,7 +1988,7 @@ rb_str_times(VALUE str, VALUE times)
* details of the format string.
*
* "%05d" % 123 #=> "00123"
* "%-5s: %08x" % [ "ID", self.object_id ] #=> "ID : 200e14d6"
* "%-5s: %016x" % [ "ID", self.object_id ] #=> "ID : 00002b054ec93168"
* "foo = %{foo}" % { :foo => 'bar' } #=> "foo = bar"
*/