Fatal Shocks

February 12, 2007

Ruby

Filed under: Uncategorized — Hasan Maqbool @ 10:43 am

It has been really great to have a scripting language like Ruby. It is really great to work in Ruby. Ruby is so dynamic. It has got the potential to break the high walls of conventional programming styles. You don’t need to declare variables in the conventional Programming Language styles. Syntax is quite elegant.

For example, if somone wants to put something on the console

Say I want to put my name in there, what I need to do is

>>puts “Hasan Maqbool”

and it will work.

Similarly, strings are so much powerful like you can say,

>>”Hasan Maqbool”.length

Output on the console will be 13.

This statement returns the length of the string which invoked the method. There are many more string methods like reverse.

>>”Hasan”.reverse

it reverses the strings like nasaH etc.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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

Blog at WordPress.com.

%d bloggers like this: