mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
c129b6119d
As @peterzhu2118 and @duerst have pointed out, putting string method's RDoc into doc/ (which allows non-ASCII in examples) makes the "click to toggle source" feature not work for that method. This PR moves the primary method doc back into string.c, then includes RDoc from doc/string/*.rdoc, and also removes doc/string.rdoc. The affected methods are: ::new #bytes #each_byte #each_line #split The call-seq is in string.c because it works there; it did not work when the call-seq is in doc/string/*.rdoc. This PR also updates the relevant guidance in doc/documentation_guide.rdoc.
17 lines
441 B
Text
17 lines
441 B
Text
Calls the given block with each successive byte from +self+;
|
|
returns +self+:
|
|
|
|
'hello'.each_byte {|byte| print byte, ' ' }
|
|
print "\n"
|
|
'тест'.each_byte {|byte| print byte, ' ' }
|
|
print "\n"
|
|
'こんにちは'.each_byte {|byte| print byte, ' ' }
|
|
print "\n"
|
|
|
|
Output:
|
|
|
|
104 101 108 108 111
|
|
209 130 208 181 209 129 209 130
|
|
227 129 147 227 130 147 227 129 171 227 129 161 227 129 175
|
|
|
|
Returns an enumerator if no block is given.
|