InsertRange(index, collection) মেথড নির্দিষ্ট পজিশনে একটি কালেকশনের সব উপাদান একসাথে ইনসার্ট করে।
উদাহরণ
using System;
using System.Collections.Generic;
public class Demo {
public static void Main() {
List list = new List { 10, 20, 30, 40, 50 };
int[] arr = { 60, 70, 80, 90 };
list.InsertRange(5, arr); // শেষে যোগ হবে
Console.WriteLine(string.Join(", ", list));
}
}
আউটপুট
10, 20, 30, 40, 50, 60, 70, 80, 90