Two Question

A

Amir Ebrahimifard

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" ?
 
J

Josh Cheek

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

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" ?
regarding 2:

5.times { puts "abc" }
5.times { print "xyz" }
 
J

Jesús Gabriel y Galán

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.
 
I

Ikpeazu Wokocha

Unsubscribe

Sent from my iPhone

n Thu, Jul 22, 2010 at 10:59 AM, Amir Ebrahimifard <[email protected]> wrot= e:
=20
http://ruby-doc.org/docs/ProgrammingRuby/html/language.html
=20
Take a look at the section: The Basic Types.
=20
=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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top