什么是“?"红宝石 [英] what is "?" in ruby
本文介绍了什么是“?"红宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
红宝石 1.9
irb(main):001:0> ?c
=> "c"
红宝石 1.8.6
irb(main):001:0> ?c
=> 99
什么是?"是什么意思?
what does "?" mean ?
推荐答案
它表示一个字符".在 ruby 1.8 中,这由字符的 ascii 代码表示.在 Ruby 1.9 中,它是一个单字符 String
.
It denotes a "character". In ruby 1.8, this was represented by the ascii-code of the character. In Ruby 1.9, it's a single-character String
.
这篇关于什么是“?"红宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文