title: Is there a LINQ function for getting the longest string in a list of strings?
body: <p>Is there a <code>LINQ</code> function for this is or would one have to code it themselves like this:</p>
  
  <pre><code>static string GetLongestStringInList()
  {
      string longest = list[0];
  
      foreach (string s in list)
      {
          if (s.Length &gt; longest.Length)
          {
              longest = s;
          }
      }
  
      return longest;
  }
  </code></pre>