From: Aldric Giacomoni Date: 2009-12-18T01:51:00+09:00 Subject: Re: Unique combination of values from arrays Milo Thurston wrote: > Here's a problem for which I can't see an obvious solution, and hope > someone might have some suggestions. > > I have several arrays, each with a variety of text values in them. I > need to construct some strings consisting of each unique combination of > the arrays in order. Here's a very simple example: > > first_array = ['one','two'] > second_array = ['three','four'] > > required output: > > one,three > one,four > two,three > two,four > > There are more arrays than that and more entries in each array, but > that's the basic idea. Any advice welcome - thanks! ar1 = [ 'one', 'two' ] ar2 = [ 'three', 'four' ] ar3 = [ 'five', 'six' ] output: one,three,five one,three,six one,four,five one,four,six two,three,five two,three,six two,four,five two,four,six Is that right? Are your arrays organized in an array of arrays? Can they be? -- Posted via http://www.ruby-forum.com/.