<p>Given a Generic List of objects that contain a member variable that is a string, what is the best way to get the object that contains the string with the longest length?</p>

<p>ie.
assuming val1 is the string I'm comparing:</p>

<pre><code>0 : { val1 = "a"   }
1 : { val1 = "aa"  }
2 : { val1 = "aba" }
3 : { val1 = "c"   }
</code></pre>

<p>what needs to be returned is object 2 because "aba" has the greatest length.</p>

Sorry, I'll try again. You can use the following aggregation:
```
```
Dim result = elements.Aggregate(Function(a, b) If(a.val1.Length > b.val1.Length, a, b))
```
```