Query expression to get minimal string length using LINQ

Amatya
Posted by Amatya under LINQ category on | Points: 40 | Views : 148
Query expression to get minimal string length using LINQ
var dnfList = new List<string> { "1000", "10200", "70000", "20","67400" };
int dnfMin = (from dnf in dnfList select dnf.Length).Min();


Result:
dnfMin 2

Thanks

Comments or Responses

Login to post response