ویرایش آیتم های ArrayList با استفاده از ایندکس در #C
سلام بر تمامی برنامه نویسان سی شارپ 😉 در این مطلب ، ویرایش آیتم های ArrayList با استفاده از ایندکس در سی شارپ #C رو براتون آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی پروژه به این صورت می باشد:
Adding 6 elements
Change first three elements
Contents: X Y Z B D F
Change first three elements
Contents: X Y Z B D F
ویرایش آیتم های ArrayList با استفاده از ایندکس :
using System;
using System.Collections;
class MainClass {
public static void Main() {
ArrayList al = new ArrayList();
Console.WriteLine("Adding 6 elements");
// Add elements to the array list
al.Add('C');
al.Add('A');
al.Add('E');
al.Add('B');
al.Add('D');
al.Add('F');
//
Console.WriteLine("Change first three elements");
using System.Collections;
class MainClass {
public static void Main() {
ArrayList al = new ArrayList();
Console.WriteLine("Adding 6 elements");
// Add elements to the array list
al.Add('C');
al.Add('A');
al.Add('E');
al.Add('B');
al.Add('D');
al.Add('F');
//
Console.WriteLine("Change first three elements");