C# StringCollection RemoveAt

Description

StringCollection RemoveAt removes the string at the specified index of the StringCollection.

Syntax

StringCollection.RemoveAt has the following syntax.


public void RemoveAt(
  int index
)

Parameters

StringCollection.RemoveAt has the following parameters.

  • index - The zero-based index of the string to remove.

Returns

StringCollection.RemoveAt method returns

Example


using System;/*from   ww  w  .  jav  a 2 s .c o 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" };
      myCol.AddRange( myArr );

      myCol.RemoveAt( 1 );

      foreach ( Object obj in myCol )
         Console.WriteLine( "   {0}", obj );
   }
}

The code above generates the following result.





















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




BitVector32
HybridDictionary
ListDictionary
OrderedDictionary
StringCollection
StringDictionary
StringEnumerator