Arrays (2)

In this post I put the number (2) because I make another post about arrays before, in this one I will put everything that is in that post and more, because arrays are such a great tools to manipulate data on Ruby, and here are some examples of how you can utilize this amazing elements on Ruby.

Arrays have Super Powers (A.K.A. Methods) on this post we will show some of this methods, for a more complete list of the methods follow the Ruby Iron-man Link below and  this 2nd-Link

Some ways to initialize an Array

Access elements of array.

How to modify Array elements

“.push” & “.unshift”

 “.insert(x, “abc”)”

 “<<”   Shoveling values.

“.pop” & “.shift”

 “.delete_at(x)”

“.join(“-“)”  to convert from Array to String

“.include?”

“.max” & “.min”

“.length” ,  “.sort”  ,  “.unique”

 

 

 

 

 



Copyright 2017. All rights reserved.

Posted January 5, 2017 by Edmundo in category "Ruby