Rubyメモ1

[mfham@localhost work]$ ruby -v
ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]
[mfham@localhost work]$ irb
2.1.8 :001 > str = 'abcde'
 => "abcde" 
2.1.8 :002 > puts str[0..-2]
abcd
 => nil 
2.1.8 :003 > (0..-2).each do |n| puts n end
 => 0..-2 
2.1.8 :004 >