Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Two Question

Reply
Thread Tools

Two Question

 
 
Amir Ebrahimifard
Guest
Posts: n/a
 
      07-22-2010
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/.

 
Reply With Quote
 
 
 
 
Josh Cheek
Guest
Posts: n/a
 
      07-22-2010
[Note: parts of this message were removed to make it a legal post.]

On Thu, Jul 22, 2010 at 3:59 AM, Amir Ebrahimifard <(E-Mail Removed)> 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" }

 
Reply With Quote
 
 
 
 
Jesús Gabriel y Galán
Guest
Posts: n/a
 
      07-22-2010
n Thu, Jul 22, 2010 at 10:59 AM, Amir Ebrahimifard <(E-Mail Removed)> wrote:
> Hi everybody
> I have two question :
> 1 - What is the exact meaning of Literals in Ruby ?


http://ruby-doc.org/docs/Programming.../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.

 
Reply With Quote
 
Ikpeazu Wokocha
Guest
Posts: n/a
 
      07-22-2010
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 <(E-Mail Removed)> wrot=

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

>=20
> http://ruby-doc.org/docs/Programming.../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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(8-bit binary to two digit bcd) or (8-bit binary to two digit seven segment) Fangs VHDL 3 10-26-2008 06:41 AM
How to compare two SOAP Envelope or two Document or two XML files GenxLogic Java 3 12-06-2006 08:41 PM
Router with NAT and two T1 and two ISP's John Cisco 4 10-16-2004 02:03 AM
Two ISP -Two Routers - 1 PIX James Parks Cisco 5 12-11-2003 08:55 PM
Cisco 2611 with Two T1 from two ISPs Adam Embrey Cisco 3 07-24-2003 10:22 PM



Advertisments