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

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.

主站蜘蛛池模板: 襄汾县| 乐陵市| 大埔县| 平舆县| 邢台县| 偃师市| 固原市| 华亭县| 壶关县| 哈尔滨市| 民权县| 车致| 呼和浩特市| 灵川县| 丹寨县| 鄂托克前旗| 泰安市| 兖州市| 榕江县| 北碚区| 眉山市| 灵宝市| 秀山| 武山县| 永州市| 广德县| 高雄县| 高唐县| 疏勒县| 晴隆县| 利津县| 石家庄市| 红河县| 乐清市| 唐海县| 鹤峰县| 棋牌| 正蓝旗| 大邑县| 三江| 望江县|