Как использовать StringComparison
свойства в приведенном ниже коде?
string _strVariable = "New York";
//nestList is nested list, list of list of objects, city below is an object, not a string
var _countVar = nestList
.SelectMany(list => list)
.Count(city => string.Equals(city, _strVariable));
Пробовал ниже, но они не работают, выдает ошибку.
var _countVar = nestList
.SelectMany(list => list)
.Count(city => string.Equals(city, _strVariable,StringComparison.OrdinalIgnoreCase));
var _countVar = nestList
.SelectMany(list => list)
.Count(city => string.Equals(city, _strVariable,StringComparer.OrdinalIgnoreCase));