mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[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" ```
This commit is contained in:
parent
11862c1a7c
commit
045ab1d056
Notes:
git
2022-02-13 15:48:28 +09:00
1 changed files with 1 additions and 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
|
||||
|
|
Loading…
Add table
Reference in a new issue