From: Day Date: 2008-02-04T14:34:39+09:00 Subject: Re: shorter form of concat This is not pretty, but... x = 1 y = 10 string = "#{x}#{y}" puts string => 110 I'm not sure I'd use that in production code, but there it is... Ben On Feb 3, 2008 11:23 PM, SpringFlowers AutumnMoon wrote: > Tim Hunter wrote: > > SpringFlowers AutumnMoon wrote: > >> the following line will concat "1" all the way to "10"... but is there > >> a shorter way... like x . y or must it be this long? > >> > >> > >> p (1..10).inject{|x,y| x.to_s + y.to_s} > > > > (1..10).to_a.join > > > what i mean is, any shorter way to concat two numbers? something > similar to x . y > > > > -- > Posted via http://www.ruby-forum.com/. > >