gistlib
other ruby categories
arrays code snippets in ruby
add an element to the end of an array in ruby
check if array is empty in ruby
check if array is not empty in ruby
concatenate two arrays in ruby
count instances of an element inside an array in ruby
count words in array in ruby
create a csv file in ruby
find all the strings matching ‘tony’ in an array of strings, then return how many there are. if there are none then return nil in ruby
find the average of a list of numbers in ruby
find the index of an element in an array in ruby
find the kth largest element in an array in ruby
find the kth largest key in a map in ruby
find the kth longest word in a string in ruby
find the kth most common element in an array in ruby
find the kth smallest element in an array in ruby
find the last element in an array in ruby
find the length of an array in ruby
find the median of a list of numbers in ruby
find the median of all elements in an array in ruby
find the median of all keys in a map in ruby
find the mode of a list of numbers in ruby
find the range of all elements in an array in ruby
find the standard deviation of all elements in an array in ruby
get a sample of 5 elements from an array in ruby
insert an element into an array at a specific index in ruby
iterate an array of strings with index in ruby
iterate over an array of strings with index using the map function in ruby
join an array of substrings into a string in ruby
remove an element from an array at a specific index in ruby
remove an element from the beginning of an array in ruby
remove an element from the end of an array in ruby
remove an element from the middle of an array in ruby
reverse an array in ruby
shuffle an array in ruby
split a string into an array of substrings in ruby
gistlib
by LogSnag