Roshan Book

My Tech Notebook

Learning Ruby Part 7–Strings


String means bunch of text like “my name is manish”

 

Declaring a string

My name is Manish

Methods of Strings

.length  – >Returns number of characters. It includes space

.upcase –> Converts everything to uppercase

+ –> It adds two strings

.reverse-> It reverse the strings

.reverse.upcae – > Here we added two methods for a string. It will reverse and change string to uppercase

Full list of string methods can be found here

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: