Skip to content

Instantly share code, notes, and snippets.

@polatengin
Last active July 3, 2017 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polatengin/6ed8dfb4576c6c5f43a4f9b52b98ed18 to your computer and use it in GitHub Desktop.
Save polatengin/6ed8dfb4576c6c5f43a4f9b52b98ed18 to your computer and use it in GitHub Desktop.
C# 1 vs C# 6
using System;
public class Program
{
static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Parametresiz");
}
else
{
Console.WriteLine("Parametreli: " + string.Join(",", args));
}
}
}
using static System.Console;
public class Program
{
static void Main(string[] args)
{
WriteLine((args.Length == 0) ? "Parametresiz" : $"Parametreli: {string.Join(",", args)}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment