Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# tuple

 var tupleList = new List<Tuple<int, string, string, string>>();
 tupleList.Add(Tuple.Create(1, "Sefat Anam", "Dhaka Bangladesh", "0.1245345"));
Comment

tuples in c#

//You can define tuples with an arbitrary large number of elements:
var t = 
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26);
Console.WriteLine(t.Item26);  // output: 26

//You can explicitly specify the names of tuple fields either in a 
//tuple initialization expression or in the definition of a tuple 
//type, as the following example shows:
var t = (Sum: 4.5, Count: 3);
Console.WriteLine($"Sum of {t.Count} elements is {t.Sum}.");

(double Sum, int Count) d = (4.5, 3);
Console.WriteLine($"Sum of {d.Count} elements is {d.Sum}.");
Comment

Tuples in C#

public class Program
    {
        static void Main(string[] args)
        {
           var test = new Tuple<int, int> ( 10,11);
            Console.WriteLine(test.Item1);
            Console.WriteLine(test.Item2);

            var hugeTuble = Tuple.Create(1,2,3,4,5,6,7,(1,2,3,4,5,6,7,8));
            Console.ReadLine();
        }
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# get random index from list 
Csharp :: unity deactive all object in list 
Csharp :: c sharp 
Csharp :: finding values in the registry 
Csharp :: for jump script unity 2d 
Csharp :: C# xamaring form change text on label 
Csharp :: how to change all values in dictionary c# 
Csharp :: .net 4.5 use tls 1.2 
Csharp :: c# split include separators 
Csharp :: c# check if object is of any generic type 
Csharp :: c# only letters 
Csharp :: get position of another object unity 
Csharp :: foreach c# linq example 
Csharp :: unity werfen mit höhe 
Csharp :: aspx receive variable from url 
Csharp :: unity pickup and drop objects 
Csharp :: dinktopdf page break 
Csharp :: multiply structs c# 
Csharp :: save position unity 
Csharp :: unity c# destroy gameobject 
Csharp :: C# show text in another form 
Csharp :: demand a Security action c# 
Csharp :: asp.net c# get user email address from AD 
Csharp :: c# draggable controls 
Csharp :: remove substring from string c# 
Csharp :: lwjgl fullscreen 
Csharp :: factorial of any number 
Csharp :: self referencing loop detected for property entity framework 
Csharp :: convert rgb to float 
Csharp :: declare prop array c# 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =