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
SharePoint 2007 List Item Save Conflicts
Randomizing the TIME but not DATE of a timestamp in Mysql
Cross-Browser time/date javascript
Pivot Table with dynamic column headers
missing files after chkdsk!!!!!!!!!!!!
ACCESS 2007: Transfer information from one table to multiple tables depending on the ID
Failed to open the Group Policy Object.
how to concatenate into the starting of a file ?
Hyperlink an IP Address - Access 97
Convert .FLA file to a .FLV file