summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-29 08:40:22 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-29 08:40:22 +0000
commit552a5a993c5af520926d1b1689d59c70bd1298af (patch)
tree34e213e535b14e96e2816175eb28fcb58ee83c8c /string.c
parent3bc2f5a9b6a846c79f402ca9e3981540db8c8925 (diff)
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
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 9079387fac..90347246f9 100644
--- a/string.c
+++ b/string.c
@@ -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"
*/