From: Guillaume Loader Date: 2009-02-19T09:39:23+09:00 Subject: Dynamic string (depending on a variable) Hello everyone! Do you have a better way to do this ? sentence = "Your ticket has expired since #{nb_of_days if nb_of_days<0} #{'days' if nb_of_days<0} #{'today' if nb_of_days==0}" My goal is to print something like this : "Your ticket has expired since 4 days" or "Your ticket has expired since today" I've tried this : sentence = "Your ticket has expired since #{nb_of_days + 'days' if nb_of_days<0} #{'today' if nb_of_days==0}" But it doesn't work! Thank you for your help :) -- Posted via http://www.ruby-forum.com/.