We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The unary ? operator produces a single character string in Ruby 1.9 and above. In previous versions it would produce the ASCII value for a character, so ?d #=> 100. Frankly it's an obscure bit of syntax that has no purpose beyond code golf.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
The unary
?
operator produces a single character string in Ruby 1.9 and above. In previous versions it would produce the ASCII value for a character, so?d #=> 100
. Frankly it's an obscure bit of syntax that has no purpose beyond code golf.