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

Printing strings

In the preceding code snippet, we're printing out a string that we have properly wrapped in quotation marks. Note that both single and double quotation marks work properly.

It's also important that you do not mix the quotation mark types. For example, run the following code:

puts "Name an animal' 

You will get an error, because you need to ensure that every quotation mark is matched with a closing (and matching) quotation mark.

If you start a string with a double quotation mark, the Ruby parser requires that you end the string with a matching double quotation mark.

主站蜘蛛池模板: 成安县| 镶黄旗| 茌平县| 德昌县| 揭东县| 嘉善县| 宜黄县| 阿巴嘎旗| 搜索| 武汉市| 天气| 遵义县| 三门县| 昌图县| 东丰县| 九江市| 兰西县| 北流市| 东山县| 东港市| 隆回县| 翼城县| 太康县| 南华县| 色达县| 云浮市| 杭锦旗| 竹溪县| 乳山市| 大关县| 甘孜| 仪征市| 晋城| 岳阳县| 台安县| 临海市| 仪征市| 金华市| 南平市| 涿鹿县| 贵阳市|