From: Patrick Gundlach Date: 2005-07-26T01:05:59+09:00 Subject: Re: Newby question 'unless' Hi, > def to_s > "#{@a}" + "#{@b}" unless @a == 0 > end def to_s "#{@a}" + (@a == 0 ? "" : "#{@b}" ) end > def to_s > s = "\n#{@post}" > if @post != :GK > s += "#{@side}" s += creates a new object. Doing << on strings is much faster. Patrick