title: How to use ranges with List in C#?
body: <p>With C# 8 we got ranges to get &quot;sub lists&quot;.</p>
  <p>While this works:</p>
  <pre><code>var array = new string[] { &quot;abc&quot;, &quot;def&quot;, &quot;ghi&quot; };
  var subArray = array[0..1]; // works
  </code></pre>
  <p>This does not:</p>
  <pre><code>var list = new List&lt;string&gt; { &quot;abc&quot;, &quot;def&quot;, &quot;ghi&quot; };
  var subList = list[0..1]; // does not work
  </code></pre>
  <p>How can I use ranges with lists?</p>