Skip to content

Instantly share code, notes, and snippets.

@san9dev
Created March 13, 2020 14:13
Show Gist options
  • Save san9dev/38ece6e2863d9967c339fe6a071162d2 to your computer and use it in GitHub Desktop.
Save san9dev/38ece6e2863d9967c339fe6a071162d2 to your computer and use it in GitHub Desktop.
Delete item of array in ruby
arr = [1, 2, 3, [4, 5]]
arr.each { |i| i.delete_at(0) if i.is_a?(Array) } # [1, 2, 3, [5]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment