On Wed, Nov 30, 2011 at 14:26, Adam Prescott <adam / aprescott.com> wrote: > You can do it with #chars, too. Oh yeah! Good catch! That knocks four chars (no pun intended) off my solution. > "2011".chars.inject(0) { |a, b| a + b.to_i } Yup, inject was part of what I was thinking. The other half is map. Result, using chars: "2011".chars.map(&:to_i).inject(&:+) Can anyone make that even shorter? Let's play Ruby Golf! ;-) -Dave -- LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages. Where: Northern Virginia, Washington DC (near Orange Line), and remote work. See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence). Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson)