зеркало из https://github.com/github/ruby.git
Fix rdoc of String#byteslice. Feature #4447
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b8b48f9d58
Коммит
d301b4d80b
3
string.c
3
string.c
|
@ -4064,11 +4064,12 @@ str_byte_aref(VALUE str, VALUE indx)
|
|||
* Byte Reference---If passed a single <code>Fixnum</code>, returns a
|
||||
* substring of one byte at that position. If passed two <code>Fixnum</code>
|
||||
* objects, returns a substring starting at the offset given by the first, and
|
||||
* a length given by the second. If given a range, a substring containing
|
||||
* a length given by the second. If given a <code>Range</code>, a substring containing
|
||||
* bytes at offsets given by the range is returned. In all three cases, if
|
||||
* an offset is negative, it is counted from the end of <i>str</i>. Returns
|
||||
* <code>nil</code> if the initial offset falls outside the string, the length
|
||||
* is negative, or the beginning of the range is greater than the end.
|
||||
* The encoding of th3 resulted string is always ASCII-8BIT.
|
||||
*
|
||||
* "hello".byteslice(1) #=> "e"
|
||||
* "hello".byteslice(-1) #=> "o"
|
||||
|
|
Загрузка…
Ссылка в новой задаче