Sign up or Sign in | Share
 
ClearMyBench
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Ruby basics (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Ruby basics
#4421
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
4 str << obj

Concatenates an object to str. If the object is a Fixnum in the range 0.255, it is converted to a character. Compare it with concat.


5 str <=> other_str
Compares str with other_str, returning -1 (less than), 0 (equal), or 1 (greater than). The comparison is casesensitive.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4422
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
6. str == obj

Tests str and obj for equality. If obj is not a String, returns false; returns true if str <=> obj returns 0.


7 str =~ obj

Matches str against a regular expression pattern obj. Returns the position where the match starts; otherwise, false.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4423
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
8. str =~ obj

Matches str against a regular expression pattern obj. Returns the position where the match starts; otherwise, false.


9 str.capitalize

Capitalizes a string.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4424
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
10 str.capitalize

Same as capitalize, but changes are made in place.

11 str.casecmp

Makes a case-insensitive comparison of strings.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4425
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
11 str.casecmp

Makes a case-insensitive comparison of strings.

12 str.center

Centers a string.

13 str.chomp

Removes the record separator ($/), usually \n, from the end of a string. If no record separator exists, does nothing.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4426
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
14. str.chomp!

Same as chomp, but changes are made in place.

15 str.chop

Removes the last character in str.

16 str.chop!

Same as chop, but changes are made in place.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
logo footer   Copyright 2009 - 2013 HotRecruiter.Com - All Rights Reserved