Query expression to get maximal string length using selector.

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 172
Query expression to get maximal string length using selector.


var dnfList = new List<string> { "10", "200", "3000", "40000" };
int dnfMaxLen = (from dnf in dnfList select dnf.Length).Max();


Result
dnfMaxLen 5

Comments or Responses

Login to post response