johnnyg123
asked on
List of possible combinations
I am trying to write some vb.net code that will list all possible combnations of a lst of words.
Currently, I'm interested in the non repeating combination of 4 words "brand", "kind", "size" and "weight". order is not important.
for example,
I would like to see
brand
brand,kind
brand,kind,size
brand,kind,size,weight
etc
by non repeating I mean for example that
if brand,kind is listed i do not want to see kind,brand
Any ideas???
Currently, I'm interested in the non repeating combination of 4 words "brand", "kind", "size" and "weight". order is not important.
for example,
I would like to see
brand
brand,kind
brand,kind,size
brand,kind,size,weight
etc
by non repeating I mean for example that
if brand,kind is listed i do not want to see kind,brand
Any ideas???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Load them into an array.
Loop through the array, appending the next word in.
Ex:
Dim x As String() = "r,t".Split(",")
Dim s As String
s = ""
For i As Integer = 0 To x.Length
s = s + x(i)
'output S
Next