Created
May 23, 2024 17:08
-
-
Save renatogroffe/5455afd9d46994dd932761b8e56a6ce4 to your computer and use it in GitHub Desktop.
This file contains 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
using System.Runtime.InteropServices; | |
Console.WriteLine("***** Testes com .NET 9 + C# 13 | params collections *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment | |
.OSVersion.VersionString}"); | |
Console.WriteLine(); | |
ProcessWords("Mais", "uma", "live", "no", "Canal", ".NET"); | |
ProcessWords(["Dessa", "vez", "com", "o", "Tio", "do", "C#", "e", "o", "Tio", "do", "Container"]); | |
string[] group3 = ["Vamos", "aprender", "mais", "sobre", "C#"]; | |
ProcessWords(group3); | |
List<string> group4 = ["E", "ainda", "tem", "muito", "mais", "por", "vir"]; | |
ProcessWords(group4); | |
static void ProcessWords(params IEnumerable<string> words) | |
{ | |
Console.WriteLine($"Tipo encontrado = {words.GetType().FullName}"); | |
Console.WriteLine($"Numero de palavras = {words.Count()}"); | |
Console.Write("Concatenacao = "); | |
foreach (var word in words) | |
Console.Write(word + " "); | |
Console.WriteLine(); | |
Console.WriteLine(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment