Last active
August 29, 2015 14:14
-
-
Save ycaroafonso/25438e88490e7881fab8 to your computer and use it in GitHub Desktop.
Tuple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Exemplo 1: | |
| Tuple<int, string, DateTime> pessoa = new Tuple<int, string, DateTime>(1, "Ycaro", new DateTime(2015, 2, 6)); | |
| Console.Write(string.Format("ID: {0}, Nome: {1}, Data: {2:dd/MM/yyyy}", pessoa.Item1, pessoa.Item2, pessoa.Item3)); | |
| // Exemplo 2: | |
| int id = 2; | |
| string nome = "Ycaro 2"; | |
| DateTime data = new DateTime(2015, 2, 7); | |
| pessoa = Tuple.Create(id, nome, data); | |
| Console.Write(string.Format("ID: {0}, Nome: {1}, Data: {2:dd/MM/yyyy}", pessoa.Item1, pessoa.Item2, pessoa.Item3)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment