Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (42 sloc) 1.09 KB
Developer: Dan Chuparkoff (Twitter: @chuparkoff )
Creation Date: 4/13/2012
Initial Ruby Version: Ruby 1.9.3-p125
Initial Development Environment: Windows 7 Home Premium - SP1
Initial Development IDE: Jetbrains RubyMine 4.0.2
This program was created as an exercise in the RubyLearning PORPC101-32C Course.
This program illustrates some basic use of Variables and String Operations.
# Defining a Constant
PI = 3.14159
puts PI
# Defining a lccal variable
myString = 'I love my city, Chicago'
puts myString
.to_i, .to_f, .to_s
var1 = 5;
var2 = '2'
puts var1 + var2.to_i
# << appending to a string
a = 'hello '
I love this world...'
puts a
<< marks the start of the string literal and
is followed by a delimiter of your choice.
The string literal then starts from the next
new line and finishes when the delimiter is
repeated again on a line on it's own. This
is known as Here document syntax.'
a = <<END_STR
This is the string
And a second line
puts a