Skip to content

Ruby class : Day 3

16/12/2010

This day i learned as,

==>chomp : eliminate the last “\n” from string.

==>chop : eliminate the last character in string.

==>Array declaration another way:

array=%w[s h a n m u g a m]

w for word

==>split()

> “shanmugam”.split(”)

>[“s”, “h”, “a”, “n”, “m”, “u”, “g”, “a”, “m”]

can split line to array by split(‘ ‘)

==>know about in-line and out-line documendation

==>a program must have the following

=begin
program to for what
input: write what is the input
who wrote the program
program written date
program last modification date
=end

Advertisements

From → Ruby

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: