title: All Possible Combinations of a list of Values
body: <p>I have a list of integers <code>List&lt;int&gt;</code> in my C# program. However, I know the number of items I have in my list only at runtime.</p>
  <p>Let us say, for the sake of simplicity, my list is <code>{1, 2, 3}</code>
  Now I need to generate <em>all possible combinations</em> as follows.</p>
  <pre><code>{1, 2, 3}
  {1, 2}
  {1, 3}
  {2, 3}
  {1}
  {2}
  {3}
  </code></pre>
  <p>Can somebody please help with this?</p>