我想要以下代码:
List<Tuple<string, double>> historicalDailyHigh = new List<Tuple<string, double>>();
foreach (var item in historicalDailyHigh)
{
if (item.Item1.Contains(closestPreDailyHigh.ToString()))
{
closestPreDailyHighName = item.Item1;
}
}
写在一行中,类似于这一行,只有“closestPreDailyHighName”应该是一个字符串:
closestPreDailyHighName = historicalDailyHigh.Any(x => x.Item1.Contains(closestPreDailyHigh.ToString()));
有人可以给我一个关于如何做到这一点的提示吗?