542 questions
You are about to replace all of the ruby strings with uppercase and lowercase characters.I used str.upper() in PythonI tried everything with upper, tupper, upperCase, and convertUpper, but it didn't w...
I'm embarrassed because it's such a simple question.Except for lowercase letters, I want to randomly extract 8 capital letters. For me,value = ; 8.times{value << (65 + rand(25)).chr}#Including l...
How do I make a number from 0 to n in ruby?
After removing the key from the hash on Ruby/Rails, how can I get only the remaining hash returned?To add a new hash {:a => 1, :b => 2}.merge!({:c => 3}) # => {:a=>1, :b=>2, :c=>3...
What does :: do in Foo::Bar?I thought it was related to encapsulation (private, protected), but it's not that when I looked at the definition.The :: is a unary operator that allows: constants, instanc...
How do I get input to command line as ruby?> cat input.txt | myprog.rb> myprog.rb < input.txt> myprog.rb arg1 arg2 arg3 ...I'm going to get stdin like this, but I'd like to know other ways...
I'm creating a program that receives a person's name and stores it in an array until an empty string is entered.When checking for empty strings, you just want to write while statements, so you need to...
I'm not used to writing Linux commands yet, so I don't know how to erase them.What is the command to clear the Ruby Version Manager (RVM)?
Error importing template from Cloud9 via heroku...I'm asking this question because it's my first time seeing heroku.The details of the error are as follows. (The language used is Ruby on Rails, Html/c...
Which method should we use to find out if a variable already exists or not in Ruby?For example, a = 3isset? a #trueisset? v #falseI'm looking for a method that returns true only when it's a variable t...
« | - 47 - | » |
© 2024 OneMinuteCode. All rights reserved.