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
How to rotate text 180º w/o using wordart?
Shell status return value
Outlook forms stay in my outbox after being sent and cause major problems.
Help with creating Bootable CD-ROM with Windows 98 and BIOS files
Server 2003 Maximum Boot Partition?
Ruby on Rails: Dealing with many-to-many relationships in one view
SQL Reporting - convert datetime to date only format
Changes services via bat file
receiving error 0x800ccc92 when trying to receive mail in Outlook 2003
Setting Up Geo Cluster Windows Server 2008 Exchange 2007