Add Enumerator support to `String#each_byte`.

`String#each_byte` is not defined in ISO Ruby but it is implemented in
the core mruby because it's useful.
parent 138845a5
......@@ -167,6 +167,7 @@ class String
##
# Call the given block for each byte of +self+.
def each_byte(&block)
return to_enum(:each_byte, &block) unless block
bytes = self.bytes
pos = 0
while pos < bytes.size
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment