Compare two excel headers using c#

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 276
public string CompareXcelHeaders(List<string> headers1, List<string> headers2)
{
var message = string.Empty;
var result = headers1.Where(x1 => !headers2.Any(x2 => x1 == x2))
.Union(
headers2.Where(x1 => !headers1.Any(x2 => x1 == x2)));

return result.Count() > 0 ? "Headers are not equal" : "Headers are equal";
}

Comments or Responses

Login to post response