প্রথমত, একটি টিপল সেট করুন -
Tuple<int, int> t = Tuple.Create(99,53);
এখন, টিপলকে একটি অ্যারেতে রূপান্তর করুন −
int[] arr = new int[]{t.Item1, t.Item2}; একটি টিপলকে অ্যারে-
-এ রূপান্তর করার জন্য নিম্নলিখিত কোডটি রয়েছেউদাহরণ
using System;
using System.Linq;
using System.Collections.Generic;
namespace Demo {
public class Program {
public static void Main(string[] args) {
Tuple<int, int> t = Tuple.Create(99,53);
int[] arr = new int[]{t.Item1, t.Item2};
foreach (int val in arr) {
Console.WriteLine(val);
}
}
}
} আউটপুট
99 53