From: Guest Date: 2006-05-12T11:36:34+09:00 Subject: Re: conversion issues corey konrad wrote: >>because it needs to be a string when you print it. > > oh ok that makes sense, isnt there a getn method for getting number or > other data types or do i always have to use gets? There could be: irb(main):001:0> def getn irb(main):002:1> foo = gets irb(main):003:1> foo.to_i irb(main):004:1> end => nil irb(main):005:0> bar = getn 123 => 123 irb(main):006:0> bar => 123 irb(main):007:0> bar.class => Fixnum irb(main):008:0> or irb(main):008:0> def getaray irb(main):009:1> foo = gets irb(main):010:1> foo.split(' ') irb(main):011:1> end => nil irb(main):012:0> bar = getaray foo bar baz => ["foo", "bar", "baz"] irb(main):013:0> bar => ["foo", "bar", "baz"] irb(main):014:0> (neither of these is well written, but work for a proof of concept) > > Thanks -- Posted via http://www.ruby-forum.com/.