From: Sven Schwyn Date: 2008-01-11T01:21:26+09:00 Subject: Re: IF me like Ruby does Here's a version that's easier to read. Assume you want to concat A and B with a space in between provided the method add_B? returns true. 'A' + ((add_B?)?(' B'):('')) The closest alternative I came up with: ['A', (' B' if add_B?)].join The more generic form, however, will not do the trick: ['A', ('B' if add_B?)].join(' ') However, this adds a tailing space if add_B? returns false. -- Posted via http://www.ruby-forum.com/.