title: List<Uri> How do I get at its contents?
body: <p>I've got the following class that uses the HtmlAgilityPack to create a list of uri's from  the current page/document.</p>
  
  <pre><code>public List&lt;Uri&gt; getLinks() 
  {
      var linksOnPage = from lnks in doc.DocumentNode.Descendants()
                        where lnks.Name == "a" &amp;&amp;
                             lnks.Attributes["href"] != null &amp;&amp;
                             lnks.InnerText.Trim().Length &gt; 0
                        select new
                            {
                                Url = lnks.Attributes["href"].Value,
                            };
  
      List&lt;Uri&gt; Uris = new List&lt;Uri&gt;();
  
      foreach (var link in linksOnPage)
      {
          Uri baseUri = new Uri(urlBase, UriKind.Absolute);
          Uri page = new Uri(baseUri, link.Url.ToString());
          Uris.Add(page);
      }
  
      return Uris;
  }
  </code></pre>
  
  <p><strong>So, I have the following questions:</strong></p>
  
  <ol>
  <li><p>How do I get the first item in the list when calling this class from elsewhere in my code? - Answered.</p></li>
  <li><p>How do I loop through all the uris in the list should I wish to write them out for example, when calling this from elsewhere in my code? - Answered</p></li>
  <li><p>How can I adapt this so that it reads the uris from an input string rather than the whole document?</p></li>
  </ol>