From: "Chr. Rippel" Date: 2002-02-07T22:43:43+09:00 Subject: Re: shuffle (all possible sequences) "Chr. Rippel" wrote in .... > class String > def consists_of? (other) > return false unless length == other.length > tmp = other > rep = '' > each_byte do |i| > return false unless tmp.sub!(i.chr,rep) > end > return true > end > end I guess it is worthwhile to point out that it is possible to turn any of the sorting algorithms into a ``up to permutation comparison algorithm'' - The above algorithm does this for bubble-sort but the better ones like merge and qsort are (algorithmically) much faster in recognizing a ``!='' situation then completely sorting both strings. /Christoph