From: "SHULTZ,BARRY (HP-Israel,ex1)" Date: 2002-02-08T01:13:41+09:00 Subject: RE: shuffle (all possible sequences) > > Here's a different solution that will only return true if > > the two words have the exact same length and the > > exact same letters: > > > > def consists_of? (other) > > a = self.split(//) > > b = other.split(//) > > a.sort == b.sort > > end > > Or, if you want to use the fabulous strbsrt extension available > on RAA: > > require 'strbsrt' > class String > def consists_of?(other) > sort_bytes == other.sort_bytes > end > end > > (Wow! What genius contributed that extension? :-) > > The same one I should have credited with my split/sort version ( ruby-talk:8152 ) :0)