From: "Thomas B." Date: 2008-09-01T18:41:27+09:00 Subject: Re: string, adding a numeric value to a part Mayuresh Kathe wrote: > Hello, > > Suppose there's a variable called 'a' with a value = 1. > Then I build a string "#{a} is really two", which when printed gives > "1 is really two". > How could I add a 1 to the a in that string to make it "2 is really > two"? > > Is there some way I could do something like "#{a}.to_i + 1 is really > two"? > > Best, Inside #{} you can put whatever you want. "#{a+1} is really two". TPR. -- Posted via http://www.ruby-forum.com/.