Two Question

Discussion in 'Ruby' started by Amir Ebrahimifard, Jul 22, 2010.

  1. Hi everybody
    I have two question :
    1 - What is the exact meaning of Literals in Ruby ?
    2 - What is the use of "puts" in Ruby and what is diffrence between
    "puts" and "print" ?
    --
    Posted via http://www.ruby-forum.com/.
     
    Amir Ebrahimifard, Jul 22, 2010
    #1
    1. Advertising

  2. Amir Ebrahimifard

    Josh Cheek Guest

    [Note: parts of this message were removed to make it a legal post.]

    On Thu, Jul 22, 2010 at 3:59 AM, Amir Ebrahimifard <> wrote:

    > Hi everybody
    > I have two question :
    > 1 - What is the exact meaning of Literals in Ruby ?
    > 2 - What is the use of "puts" in Ruby and what is diffrence between
    > "puts" and "print" ?
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >

    regarding 2:

    5.times { puts "abc" }
    5.times { print "xyz" }
     
    Josh Cheek, Jul 22, 2010
    #2
    1. Advertising

  3. n Thu, Jul 22, 2010 at 10:59 AM, Amir Ebrahimifard <> wrote:
    > Hi everybody
    > I have two question :
    > 1 - What is the exact meaning of Literals in Ruby ?


    http://ruby-doc.org/docs/ProgrammingRuby/html/language.html

    Take a look at the section: The Basic Types.

    > 2 - What is the use of "puts" in Ruby and what is diffrence between
    > "puts" and "print" ?


    As Josh says it's easy to try and see:

    puts "a"
    puts "b"
    print "a"
    print "b"

    Or also, you can read the explanation here:

    puts: http://ruby-doc.org/core/classes/IO.html#M002252
    print: http://ruby-doc.org/core/classes/Kernel.html#M005952

    Jesus.
     
    Jesús Gabriel y Galán, Jul 22, 2010
    #3
  4. Unsubscribe

    Unsubscribe

    Sent from my iPhone

    On 22 Jul 2010, at 11:04, Jes=C3=BAs Gabriel y Gal=C3=A1n <jgabrielygalan@gm=
    ail.com> wrote:

    > n Thu, Jul 22, 2010 at 10:59 AM, Amir Ebrahimifard <> wrot=

    e:
    >> Hi everybody
    >> I have two question :
    >> 1 - What is the exact meaning of Literals in Ruby ?

    >=20
    > http://ruby-doc.org/docs/ProgrammingRuby/html/language.html
    >=20
    > Take a look at the section: The Basic Types.
    >=20
    >> 2 - What is the use of "puts" in Ruby and what is diffrence between
    >> "puts" and "print" ?

    >=20
    > As Josh says it's easy to try and see:
    >=20
    > puts "a"
    > puts "b"
    > print "a"
    > print "b"
    >=20
    > Or also, you can read the explanation here:
    >=20
    > puts: http://ruby-doc.org/core/classes/IO.html#M002252
    > print: http://ruby-doc.org/core/classes/Kernel.html#M005952
    >=20
    > Jesus.
    >=20
     
    Ikpeazu Wokocha, Jul 22, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fangs
    Replies:
    3
    Views:
    9,802
    darshana
    Oct 26, 2008
  2. DC Gringo
    Replies:
    2
    Views:
    2,308
    Nikhil Patel
    Feb 26, 2004
  3. Mark
    Replies:
    3
    Views:
    514
    bruce barker
    Aug 26, 2004
  4. Darrel
    Replies:
    2
    Views:
    314
    darrel
    Nov 4, 2004
  5. GenxLogic
    Replies:
    3
    Views:
    1,289
    andrewmcdonagh
    Dec 6, 2006
Loading...

Share This Page