Is there a LINQ
function for this is or would one have to code it themselves like this:
static string GetLongestStringInList()
{
string longest = list[0];
foreach (string s in list)
{
if (s.Length > longest.Length)
{
longest = s;
}
}
return longest;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…