From: Olivier Renaud Date: 2007-02-23T22:18:34+09:00 Subject: Re: Ruby's "case" doesn't behave like a normal switch Le vendredi 23 f�vrier 2007 11:30, Brian Candler a �crit�: > On Fri, Feb 23, 2007 at 02:05:10PM +0900, Guillaume Nargeot wrote: > > > case x > > > when "this", "that" > > > func_this_that() > > > when "nothing" > > > # something different > > > end > > > > Thank you very much !!! > > I thought I tested everything, but obviously not this one. > > I didn't even find anything about it in the official documentation. > > http://www.rubycentral.com/book/tut_expressions.html > Search down to the section headed "Case Expressions" I didn't know about this syntax, either. Thanks, Eban ! For the Strings, I thought about using Regex, instead : case x when /this|that/ func_this_that() when "nothing" # something different end -- Olivier Renaud