title: Get all combination without repetition
body: <p>I have this code:</p>
  
  <pre><code>        Dim combinations As New List(Of String)
  
          Dim word As String = "abc"
  
          For c1 = 0 To word.Length - 1
              combinations.Add(word(c1))
              For c2 = 0 To word.Length - 1
                  If c2 &lt;&gt; c1 Then
                      combinations.Add(word(c1) &amp; word(c2))
                      For c3 = 0 To word.Length - 1
                          If c3 &lt;&gt; c2 And c3 &lt;&gt; c1 Then
                              combinations.Add(word(c1) &amp; word(c2) &amp; word(c3))
                          End If
                      Next
                  End If
              Next
          Next
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>a, ab, abc, ac, acb, b, ba, bac, bc, bca, c, ca, cab, cb, cba
  </code></pre>
  
  <p>How to make a function, which would do the same thing for unlimited word length?</p>