method

shift

Importance_1
Ruby latest stable (v1_8_6_287) - 0 notes - Class: Array
shift() public

Returns the first element of self and removes it (shifting all other elements down by one). Returns nil if the array is empty.

   args = [ "-m", "-q", "filename" ]
   args.shift   #=> "-m"
   args         #=> ["-q", "filename"]
Show source
Register or log in to add new notes.