Reputation: 899
I do not understand the ?
in ?x.succ
. What is it?
(This question was prompted by this answer on code golf.)
Upvotes: 2
Views: 80
Reputation: 211610
That just means "character", as in ?x
is "x character". This was a bigger deal in versions of Ruby prior to 1.9. Now it's mostly an anachronism.
Ruby 1.9+:
?x
# => "x"
Ruby 1.8.7 and prior:
?x
# => 120
This was similar to how 'x'
in C is a single character where "x"
is a character string.
Upvotes: 4