From: Konrad Meyer Date: 2007-11-07T10:11:04+09:00 Subject: Re: Is there a "||" that treats "" also as false? --nextPart170632860.dY6Vy8Z8vi Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Quoth Joshua Muheim: > Hi all >=20 > irb(main):001:0> "" || "asdf" > =3D> "" > irb(main):002:0> nil || "asdf" > =3D> "asdf" > irb(main):003:0> >=20 > I'd like the first one to also return "asdf". So is there an operator > that fits my needs? :-) >=20 > Thanks > Josh irb(main):001:0> str =3D "" =3D> "" irb(main):002:0> str !=3D "" || "asdf" =3D> "asdf" irb(main):003:0> nil || "asdf" =3D> "asdf" HTH, =2D-=20 Konrad Meyer http://konrad.sobertillnoon.com/ --nextPart170632860.dY6Vy8Z8vi Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHMRChCHB0oCiR2cwRAlrRAKCwh1//80mYdnabvsCLlueWuBrpdgCeJTZr rxS7JHF8pjngyKSUZrEipS8= =zhK8 -----END PGP SIGNATURE----- --nextPart170632860.dY6Vy8Z8vi--