zabouth wrote: > i have looked at all the ruby manual but i cant find no way of doing > this I am very new to ruby > so here is my problem > ok first here is my code > > sum = "5:5:5" > sum = sum.split(":") > sum = sum.inject {|sum, x| sum + x } > puts sum If you happen to have Rails (or just ActiveSupport) installed: require 'rubygems' require 'active_support' '5:5:5'.split(':').map(&:to_f).sum => 15.0 Pete Yandell http://notahat.com/