Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

reverse range ruby using steps

range = 5...0
Array((range).step(-2))

## will give 5 3 1
Comment

PREVIOUS NEXT
Code Example
Ruby :: Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5 
Ruby :: rails task arguments 
Ruby :: drop rails all db 
Ruby :: ruby gem dir 
Ruby :: devise redirectt after sign up 
Ruby :: rails disable cache on dev 
Ruby :: ruby capitalize first character of sentence 
Ruby :: Your Ruby version is 3.0.0, but your Gemfile specified 2.7.4 
Ruby :: ruby trim spaces 
Ruby :: check rails version 
Ruby :: is there a way of changing the key of a hash 
Ruby :: how to delete database in rails 
Ruby :: liquid add date 
Ruby :: rails activerecord to hash 
Ruby :: ruby generate array of alphabet 
Ruby :: ruby loop through array 
Ruby :: how to update a field on after_save rails 
Ruby :: see migration history rails 
Ruby :: how to reset migrations rails 
Ruby :: string to hash ruby 
Ruby :: DEPRECATION WARNING: Sprockets method `register_engine` is deprecated. 
Ruby :: rails controller generator 
Ruby :: rails change database connection 
Ruby :: List columns in table from console 
Ruby :: ruby clear set 
Ruby :: rails change reference 
Ruby :: ruby zip rows and columns 
Ruby :: update_all 
Ruby :: rails c add timings 
Ruby :: ruby read file line by line 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =