Insert a string into the StringCollection at the specified index in CSharp
Description
The following code shows how to insert a string into the StringCollection at the specified index.
Example
using System;//from w ww . ja va 2s . c om
using System.Collections;
using System.Collections.Specialized;
public class SamplesStringCollection {
public static void Main() {
StringCollection myCol = new StringCollection();
myCol.Insert( 0, "A " );
foreach ( Object obj in myCol ){
Console.WriteLine(obj );
}
}
}
The code above generates the following result.