diff options
author | Koichi ITO <koic.ito@gmail.com> | 2022-02-13 12:17:18 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-02-13 15:48:01 +0900 |
commit | 045ab1d056e3babcb02e92f6d7e6426a936f2ca3 (patch) | |
tree | 77b67df1518feaebcebc378503f7c4b5cfbea499 /numeric.c | |
parent | 11862c1a7c89d4327e36af6187c73ca7951b4f53 (diff) |
[DOC] Fix a typo in `Integer#chr` example
The current example raises the following error. ```ruby 0..chr # => undefined local variable or method `chr' for main:Object (NameError) ``` This PR updates the example to produce the expected behavior. ```ruby 0.chr # => "\x00" ```
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5550
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3775,7 +3775,7 @@ rb_enc_uint_chr(unsigned int code, rb_encoding *enc) * represented by the value of +self+, according to the given +encoding+. * * 65.chr # => "A" - * 0..chr # => "\x00" + * 0.chr # => "\x00" * 255.chr # => "\xFF" * string = 255.chr(Encoding::UTF_8) * string.encoding # => Encoding::UTF_8 |