C# StringCollection Count

Description

StringCollection Count gets the number of strings contained in the StringCollection.

Syntax

StringCollection.Count has the following syntax.


public int Count { get; }

Example


using System;/*from   w w  w . j  a v  a 2  s .co m*/
using System.Collections;
using System.Collections.Specialized;

public class SamplesStringCollection
{

    public static void Main()  {
      StringCollection myCol = new StringCollection();
      String[] myArr = new String[] { "A", "B", "C", "java2s.com"};
      myCol.AddRange( myArr );

      Console.WriteLine( myCol.Count);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections.Specialized »




BitVector32
HybridDictionary
ListDictionary
OrderedDictionary
StringCollection
StringDictionary
StringEnumerator