Microsoft
Software
Hardware
Network
Question : Conditional Operator
Hi, is there a conditional operator in Ruby like the ? in C/C#, ie
x = y == nil ? 0 : 1
I know you can do
x = if (y == nil) then 0 else 1 end
Just wondering if the more compact is possible in Ruby.
Thanks!
Answer : Conditional Operator
you can use the ? in ruby as in C
x = y == nil ? 0 : 1
will work
Random Solutions
MS Access 2007, External table is not in the specified format (error 3274)
Trying to Force a Particualr Windows Color Scheme through group polciy and cannot find where to set it at
Entourage 2008 Secure Connection Warning
How can I capture a streaming video (done in Flash) to a local file?
Remote desktop
Firefox cannot access Internet - IE CAN!
Hidden task bar intermittently doesn't appear.
Multiple "IF" Statements in MS Excel
WebSphere 6.0 installation on Windows 2003 server cluster
How to define a bookmark in the Footer Section of Word Document.