Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2818

Noob question re:returning nil

From Nathan McDorman <nmcdorman@gmail.com>
Newsgroups comp.lang.ruby
Subject Noob question re:returning nil
Date 2011-04-13 23:27 -0500
Organization Service de news de lacave.net
Message-ID <72f3e8defb9cb5e5475d2089568692b5@ruby-forum.com> (permalink)

Show all headers | View raw


Hello all, I am a beginner programmer and a beginner to Ruby. I was just
going through a tutorial book and trying to create some programs. The
current program I am working on I am having trouble with.

I have defined a method and the last thing in the method is a puts
concatenation. The program runs and does everything correctly except for
when I call the method it puts the string and then nil underneath.

I thought the return value was the last value of the string so I don't
understand why it is doing this. How do I get rid of the nil?

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Noob question re:returning nil Nathan McDorman <nmcdorman@gmail.com> - 2011-04-13 23:27 -0500
  Re: Noob question re:returning nil Vincent Manis <vmanis@telus.net> - 2011-04-14 00:08 -0500
  Noob question re:returning nil Nathan McDorman <nmcdorman@gmail.com> - 2011-04-14 00:55 -0500

csiph-web