user@domain.invalid
12/25/2006 7:05:00 PM
Hi,
Try it in a program file : irb use to print the "inspect" method of
every object used.
ex :
irb(main):006:0> 1
=> 1
or :
irb(main):004:0> b= a.each_index {|x| print x, " -- " }
0 -- 1 -- 2 -- => ["a", "b", "c"]
irb(main):005:0> b
=> ["a", "b", "c"]
Li Chen a écrit :
>
> C:\>irb
> irb(main):001:0> a = [ "a", "b", "c" ]
> => ["a", "b", "c"]
> irb(main):002:0> a.each_index {|x| print x, " -- " }
> 0 -- 1 -- 2 -- => ["a", "b", "c"]
> irb(main):003:0>
>