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

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.

主站蜘蛛池模板: 红河县| 绥中县| 镇巴县| 扎囊县| 宁海县| 岫岩| 微山县| 哈尔滨市| 三江| 柯坪县| 铁岭县| 肇庆市| 武宁县| 大冶市| 东乡| 隆德县| 贵定县| 洛川县| 西宁市| 长宁区| 东城区| 廊坊市| 莱西市| 正安县| 阜阳市| 隆子县| 大冶市| 泾川县| 邮箱| 景泰县| 宁蒗| 佛坪县| 滕州市| 彭阳县| 会宁县| 西宁市| 合川市| 喀喇沁旗| 寻乌县| 六盘水市| 鄂托克前旗|