diff options
author | Vojta Svoboda <vojtasvoboda.cz@gmail.com> | 2015-10-07 14:26:18 +0200 |
---|---|---|
committer | Vojta Svoboda <vojtasvoboda.cz@gmail.com> | 2015-10-07 14:26:18 +0200 |
commit | bff40e2f9816974abd29322f2a50455f51acd22e (patch) | |
tree | 01177dd231841fea5dea3aa6546fde8d6630f5d3 /ruby.html.markdown | |
parent | 6dabd9568d2a99e7bbc079d0466588bf68a42283 (diff) | |
parent | 5c677e8071291520297ef3d5d8374c6d11285744 (diff) |
Merge branch 'master' into translation/brainfuck-cs
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r-- | ruby.html.markdown | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown index 7bd28d86..8f23b2e6 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -168,6 +168,10 @@ array[-1] #=> 5 # With a start index and length array[2, 3] #=> [3, 4, 5] +# Reverse an Array +a=[1,2,3] +a.reverse! #=> [3,2,1] + # Or with a range array[1..3] #=> [2, 3, 4] |