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
#4457
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  
array.insert(index, obj...)

Inserts the given values before the element with the given index (which may be negative).

array.inspect

Creates a printable version of array.

array.join(sep=$,)

Returns a string created by converting each element of the array to a string, separated by sep.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4458
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  
array.last [or] array.last(n)

Returns the last element(s) of self. If array is empty, the first form returns nil.

array.length

Returns the number of elements in self. May be zero.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4459
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  
array.nitems

Returns the number of non-nil elements in self. May be zero.

array.pop

Removes the last element from array and returns it, or nil if array is empty.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4460
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  
array.push(obj, ...)


Pushes (appends) the given obj onto the end of this array.

This expression returns the array itself, so several appends may be chained together.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4461
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  
array.reject { |item| block }

Returns a new array containing the items array for which the block is not true.

array.reject! { |item| block }

Deletes elements from array for which the block evaluates to true, but returns nil if no changes were made. Equivalent to Array#delete_if
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4462
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  
array.replace(other_array)

Replaces the contents of array with the contents of other_array, truncating or expanding if necessary.

array.reverse

Returns a new array containing array's elements in reverse order.
 
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