Created
March 13, 2020 14:13
-
-
Save san9dev/38ece6e2863d9967c339fe6a071162d2 to your computer and use it in GitHub Desktop.
Delete item of array in ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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