each() public

Calls the given block once for each element in self, passing that element as a parameter.

An Enumerator is returned if no block is given.

a = [ "a", "b", "c" ]
a.each {|x| print x, " -- " }

produces:

a -- b -- c --
Show source
Register or log in to add new notes.