From: Kyle Schmitt Date: 2008-06-28T00:59:23+09:00 Subject: Re: printf goober perhaps you're thinking of sprintf? printf returns nil, but displays the string to the screen, so what's happening here is puts(printf("blah.")) printf prints out "blah." without a return, then puts prints out the return value of printf, which is nil. so you get blah.nil To do what you want, use sprintf, which returns for the formatted string --Kyle On Fri, Jun 27, 2008 at 10:52 AM, Lloyd Linklater wrote: > Hi there! > > I was experimenting with printf thus: > > puts printf("%s is %d years old.", "booboo", 12) > > and got this result: > > booboo is 12 years old.nil > > Where does that nil originate and how do I get rid of it? > -- > Posted via http://www.ruby-forum.com/. > >