namespace sets and Special collections
{
Class Program
{
static void Main (string[] args)
{
ArrayList al = new ArrayList ();
Al. Add ("Li Qing");
Al. ADD ("John Rick");
Al. ADD ("Anne");
Al. ADD ("Galen");
Al. ADD ("card Sardinia");
Al. ADD ("brand");
Al. ADD ("Noxus's Hand");
Al. ADD ("Weapon Master");
Al. ADD ("Nash's Teeth");
Al. Add ("Blind Monk");
Al. ADD ("Galen");
Al. ADD ("Katrina");
Al. ADD ("Nine-tailed demon fox");
for (int i = 0; i < al. Count; i++)
//{
Console.WriteLine (Al[i]);//output in sequence
//}
Console.WriteLine (al. Contains ("Hand of Noxus"));//See if it contains
Console.WriteLine (al. IndexOf ("Catalina"));///See where Catalina is located (index)
Al. Insert (3, "de Eris");//In the third place before inserting a de Eris
for (int i = 0; i < al. Count; i++)
//{
Console.WriteLine (Al[i]);
//}
Al. LastIndexOf ("Galen");
Console.WriteLine (al. LastIndexOf ("Galen"));//The location of the last Galen
Al. Remove ("John Rick");//Delete the Yorick
for (int i = 0; i < al. Count; i++)
//{
Console.WriteLine (Al[i]);//output in sequence
//}
Al. RemoveAt (3);
for (int i = 0; i < al. Count; i++)
//{
Console.WriteLine (Al[i]);//output in sequence
//}
Al. Sort ();//Sort by initials
for (int i = 0; i < al. Count; i++)
// {
Console.WriteLine (Al[i]);//output in sequence
// }
Al. Reverse ();//Flip the entire collection
for (int i = 0; i < al. Count; i++)
{
Console.WriteLine (Al[i]);//output in sequence
}
Console.ReadLine ();
}
}
}
Collections and Special Collections