About 238,000 results
Open links in new tab
  1. ruby - How Do You Put 'gets' Input Into An Array? - Stack Overflow

    Mar 9, 2011 · Instead, store the user input somewhere (such as the array, see below) and get the stored value rather than asking the user twice. Further, array = [gets] replaces the existing …

  2. How to Get User Input in Ruby? - GeeksforGeeks

    Apr 10, 2024 · In Ruby, there are various methods to get input from the user, each having its own benefits and use cases. This article will discuss two different ways to obtain user input in …

  3. How to Use Ruby’s Array Class (Examples + Useful Methods)

    May 6, 2015 · An array is a built-in Ruby class, which holds a list of zero or more items, and includes methods that help you easily add, access, and loop over all these items. This is …

  4. Working with Ruby Arrays: Methods and Use Cases

    From creating and initializing arrays to accessing and modifying elements, iterating over arrays, and performing advanced operations, Ruby provides a comprehensive toolkit for handling …

  5. [Ruby]So, I'm trying to get user input into array and then ... - Reddit

    Oct 30, 2012 · The chapter explains how to create an empty array using the [] syntax, and it demonstrates the #push method used to append elements to an existing array. Those are the …

  6. arrays - Collecting and Storing User Input with Ruby - Stack Overflow

    Sep 9, 2014 · I'm working on a program that asks a user for input regarding recent financial transactions and would like some help on storing the user input into an empty array and being …

  7. Ruby | Arrays - GeeksforGeeks

    Jun 16, 2023 · Retrieving Or Accessing Elements from Array. In Ruby, there are several ways to retrieve the elements from the array. Ruby arrays provide a lot of different methods to access …

  8. Mastering Ruby Arrays: Top 10 Methods - Medium

    Nov 28, 2023 · Ruby provides a rich set of methods to manipulate arrays, making it easier to perform a variety of tasks from basic iteration to complex transformations. Understanding and …

  9. Ruby arrays - working with arrays in Ruby - ZetCode

    Oct 18, 2023 · Ruby array operations. In the following examples, we introduce several Ruby array methods.

  10. How to Get Input from the Ruby Console Using Gets and Chomp

    In this guide we'll walk through how to use the built in gets and chomp methods in Ruby. In a real world application you'll most likely use web forms or some tool like that to get input. However …

Refresh