Skip to content

Instantly share code, notes, and snippets.

@Olefine
Created May 27, 2013 09:50
Show Gist options
  • Save Olefine/5656202 to your computer and use it in GitHub Desktop.
Save Olefine/5656202 to your computer and use it in GitHub Desktop.
last elemnts in array using slice and join into string using |
def few2last(array)
array.slice(-2..-1).join("|")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment