From: Mikem94590 Date: 2009-06-26T03:35:05+09:00 Subject: Re: Ruby Output Problem On Jun 25, 11:24 am, Ben Lovell wrote: > [Note:  parts of this message were removed to make it a legal post.] > > > > On Thu, Jun 25, 2009 at 7:20 PM, Mikem94590 wrote: > > Hello all. > > I am new to Ruby, and am created a simple program that takes a name, > > and outputs "Hello " + name + ".".  My problem is that this is putting > > the output on multiple lines. > > > e.g: Hello Mike > >       . > > > What am I doing wrong? > > > Below is the simple code I am using: > > > name = gets > > puts "Hello " + name + "." > > sleep > > gets adds a newline so you should use chomp. Also, string interpolation is > usually preferable to concatenation. This example is better: > > name = gets.chomp > puts "hello #{name}." > sleep > > Ben Thank you for you quick reply. Your advice worked, and seems like something that can be used for other purposes as well.