متد GetRange برای گرفتن عناصر ArrayList در #C
سلام بر تمامی برنامه نویسان سی شارپ 😉 در این مطلب ، متد GetRange برای گرفتن عناصر ArrayList در سی شارپ #C رو براتون آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی پروژه به این صورت می باشد:
anotherArrayList[0] = some
anotherArrayList[1] = more
anotherArrayList[1] = more
متد GetRange برای گرفتن عناصر ArrayList :
using System;
using System.Collections;
public class MainClass
{
public static void Main()
{
ArrayList myArrayList = new ArrayList();
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
string[] anotherStringArray = {"Here's", "some", "more", "text"};
myArrayList.SetRange(0, anotherStringArray);
using System.Collections;
public class MainClass
{
public static void Main()
{
ArrayList myArrayList = new ArrayList();
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
myArrayList.Add("A");
string[] anotherStringArray = {"Here's", "some", "more", "text"};
myArrayList.SetRange(0, anotherStringArray);