Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arnab-developer/arc.namescompare

Compare two list of names
https://github.com/arnab-developer/arc.namescompare

csharp dotnet nuget

Last synced: 20 days ago
JSON representation

Compare two list of names

Awesome Lists containing this project

README

        

# Names compare

This is a library to compare two lists of names and return common and unique names between them.

Install in your project with [NuGet](https://www.nuget.org/packages/Arc.NamesCompare).

```
dotnet add package Arc.NamesCompare
```

Sample code to use the library.

```csharp
IEnumerable nameList1 = new List { "Name1", "Name2", "Name3", "Name4" };
IEnumerable nameList2 = new List { "Name1", "Name3", "Name5" };

ComparisonResult result = Compare.GetComparisonResult(nameList1, nameList2);

foreach(string name in result.CommonNames)
{
Console.WriteLine(name); // Name1 and Name3
}

foreach(string name in result.UniqueList1Names)
{
Console.WriteLine(name); // Name2 and Name4
}

foreach(string name in result.UniqueList2Names)
{
Console.WriteLine(name); // Name5
}
```