From: Ron Jeffries Date: 2002-02-07T20:03:33+09:00 Subject: Re: shuffle (all possible sequences) On Thu, 07 Feb 2002 09:45:03 GMT, Tobias Reif wrote: >I'm sorry; it would be way better to have a boolean method, like: >"abc".consists_of?("abc") # -> true >"acb".consists_of?("abc") # -> true >"bac".consists_of?("abc") # -> true >"bca".consists_of?("abc") # -> true > >And then, how can I say > >word_list = ['foo', 'bca'] >word_list.include? word_consisting_of('abc') ># => true There might be some really cool way that isn't coming to mind this early. Here are some possibly useful truths: 1. 'abc'.to_a.sort equals 'cba'.to_a.sort 2. ['foo' 'abc'].sort equals ['abc' 'foo'].sort 3. ['foo' 'abc'].sort doesn't equal ['cba' 'oof'].sort 4. 'abc'.include? ?b is true 5. 'abc'.include? 'b' is true 6. 'abc'.to_a.to_s == 'abc' Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.