C#-এ লিস্ট কনক্যাটেনেট করতে Concat মেথড ব্যবহার করা হয়।
লিস্ট দুটি:
var list1 = new List<int>{12, 40};
var list2 = new List<int>{98, 122, 199, 230};
Concat মেথড:
var res = list1.Concat(list2);
সম্পূর্ণ উদাহরণ
using System.Collections.Generic;
using System.Linq;
using System;
public class Demo
{
public static void Main()
{
// দুটি লিস্ট
var list1 = new List<int>{12, 40};
var list2 = new List<int>{98, 122, 199, 230};
// কনক্যাট
var res = list1.Concat(list2);
foreach (int i in res)
{
Console.WriteLine(i);
}
}
}
আউটপুট
12 40 98 122 199 230