ArrayList.Add : ArrayList « System.Collections « C# / C Sharp by API






ArrayList.Add

  


using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

class Program {
    static void Main(string[] args) {
        ArrayList baseballTeams = new ArrayList();
        baseballTeams.Add("S");
        baseballTeams.Add("r");
        baseballTeams.Add("F");

        string[] myStringArray = new string[2];
        myStringArray[0] = "G";
        myStringArray[1] = "L";

        baseballTeams.AddRange(myStringArray);

        foreach (string item in baseballTeams) {
            Console.Write(item + "\n");
        }

    }
}

   
    
  








Related examples in the same category

1.new ArrayList()
2.new ArrayList(Collection c)
3.ArrayList.AddRange
4.ArrayList.BinarySearch
5.ArrayList.Capacity
6.ArrayList.Clear()
7.ArrayList.Clone
8.ArrayList.Contains
9.ArrayList.CopyTo
10.ArrayList.GetEnumerator()
11.ArrayList.GetRange
12.ArrayList.IndexOf
13.ArrayList.Insert
14.ArrayList.InsertRange()
15.ArrayList.IsFixedSize
16.ArrayList.IsReadOnly
17.ArrayList.LastIndexOf
18.ArrayList.Remove
19.ArrayList.RemoveAt
20.ArrayList.RemoveRange
21.ArrayList.Reverse()
22.ArrayList.SetRange
23.ArrayList.Sort()
24.ArrayList.Synchronized
25.ArrayList.ToArray
26.ArrayList.ToArray(typeof(T))
27.ArrayList.TrimToSize()