Searching item in array
If you don't need to count the number of occurences, use a Set:

private readonly ISet&lt;string&gt; data = new HashSet&lt;string&gt;();

public void AddNewData()
{
    string someData = GetData();
    data.Add(someData);
}




If you need to count the occurences, you should use a Dictionary:

private readonly IDictionary&lt;string, int&gt; data = new Dictionary&lt;string, int&gt;();

public void AddNewData()
{
    string someData = GetData();
    if (data.ContainsKey(someData))
    {
        data[someData]++;
    }
    else
    {
        data[someData] = 1;
    }
}




Alternatively, you could just use a List and calculate the counts when you need them, using the LINQ GroupBy extension method:

private readonly ICollection&lt;string&gt; data = new List&lt;string&gt;();

public void AddNewData()
{
    string someData = GetData();
    data.Add(someData); // data might contain duplicates
}

public void PrintData() // use LINQ to count number of occurences
{
    foreach (var entry in data.GroupBy(x =&gt; x))
    {
        Console.WriteLine("{0} {1}", entry.Key, entry.Count());
    }
}