官术网_书友最值得收藏!

Getting input from the Ruby console using gets and chomp

Now that you know how to print values to the console, the next logical step is to know how to get input from users. In this section, 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 an input. However, using console tools you'll be able to mimic what a user types into a program.

主站蜘蛛池模板: 措勤县| 启东市| 邯郸县| 清丰县| 铜鼓县| 松江区| 柞水县| 高阳县| 东安县| 垣曲县| 丹巴县| 勃利县| 开阳县| 河西区| 滕州市| 广州市| 凤山市| 万荣县| 安溪县| 罗田县| 黄梅县| 大新县| 紫云| 锦州市| 惠来县| 丽江市| 广西| 温州市| 梨树县| 布尔津县| 新昌县| 土默特右旗| 宜兴市| 柘荣县| 泰兴市| 化德县| 巴中市| 仁寿县| 新田县| 厦门市| 昌图县|