কম্পিউটার টিউটোরিয়াল

C#-এ Tuple কে Array-তে রূপান্তর করা

প্রথমে একটি Tuple সেট করুন:

Tuple<int, int> t = Tuple.Create(99, 53);

এখন Tuple কে অ্যারেতে রূপান্তর করুন:

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
  1. পাইথন স্ট্রিংকে টাপলে কনভার্ট কীভাবে করবেন?

  2. পাইথনে লিস্টকে টাপলে কনভার্ট করবেন?

  3. পাইথন টাপলকে ডিকশনারিতে রূপান্তর করার পদ্ধতি

  4. পাইথনে হেক্স স্ট্রিংকে ইন্টিজারে রূপান্তর করা