From: Dirk Traulsen Date: 2007-10-21T16:07:08+09:00 Subject: Re: combinations listing Am 21 Oct 2007 um 7:20 hat Jesús Gabriel y Galán geschrieben: > It splits every letter of one word, sorts the letters and joins them > again. Then appends to the array corresponding to the value of the > sorted letters the actual word. For example, if this were the > dictionary file: > > abc > acb > > for abc: > word.split('') --> %w{a, b, c} Be careful: p %w(a, b, c) #=> ["a,", "b,", "c"] p %w(a b c) #=> ["a", "b", "c"] When using %w() (=array of tokens) the tokens are separated by spaces. If you additionally use commas, they will be part of the strings. Oh, and the delimiter can be any character, so look at this: p %w-(a bc de)- #=> ["(a", "bc", "de)"] p %w_a(0) { [a(0) bc]}_ #=> ["a(0)", "{", "[a(0)", "bc]}"] Dirk