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

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.

主站蜘蛛池模板: 双辽市| 怀化市| 姚安县| 乐业县| 平远县| 红桥区| 南丹县| 故城县| 石棉县| 东辽县| 临高县| 荥阳市| 阳曲县| 肥城市| 城市| 东乌珠穆沁旗| 赫章县| 伊川县| 宜州市| 乐亭县| 遂昌县| 凭祥市| 合江县| 昌邑市| 临洮县| 海安县| 安庆市| 济南市| 瑞金市| 神池县| 武城县| 绥阳县| 柏乡县| 萨嘎县| 林周县| 桑日县| 镇平县| 陵川县| 天水市| 兖州市| 车致|