C# StringCollection Item
Description
StringCollection Item
gets or sets the element at the
specified index.
Syntax
StringCollection.Item
has the following syntax.
public string this[
int index
] { get; set; }
Parameters
StringCollection.Item
has the following parameters.
index
- The zero-based index of the entry to get or set.
Example
using System;// w ww.java 2 s . c om
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[1]);
}
}
The code above generates the following result.