How to remove item from ArrayList in C#

1 Answer

0 votes
using System;
using System.Collections;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList alist = new ArrayList();

            alist.Add("java");
            alist.Add("c#");
            alist.Add("c++");
            alist.Add("python");

            alist.RemoveAt(0);

            foreach (string s in alist)
                Console.WriteLine(s);
        }
    }
}

/*
run:

c#
c++
python

*/

 



answered Jan 7, 2017 by avibootz

Related questions

1 answer 162 views
162 views asked Jan 7, 2017 by avibootz
1 answer 115 views
115 views asked Feb 28, 2023 by avibootz
1 answer 146 views
146 views asked Sep 12, 2019 by avibootz
1 answer 194 views
1 answer 162 views
162 views asked Apr 21, 2020 by avibootz
1 answer 179 views
...