सबसे पहले, एक टपल सेट करें -
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