Skip to content

Commit

Permalink
Params Collections (csharp-13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimatay committed Jun 14, 2024
1 parent 4194c77 commit e7e41fb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ParamsCollections/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// https://github.com/dotnet/csharplang/issues/7700
// https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/collection-expressions


void PrintWeekDays(params IEnumerable<string> list)
=> Console.WriteLine(string.Join(", ", list));

PrintWeekDays("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");


void PrintNumbers(params List<int>[] numbersLists)
{
foreach(var numbers in numbersLists)
Expand Down

0 comments on commit e7e41fb

Please sign in to comment.