Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string name = "Bill";
- var birthday = new DateTime(1955, 10, 28);
- // Formatted string C# 5:
- Console.WriteLine("Hello, {0}! you born a {1}.", name, birthday.DayOfWeek);
- // String interpolated C# 6:
- Console.WriteLine($"Hello, {name}! you born a {birthday.DayOfWeek}.");
- // Result:
- // Hello, Bill! you born a Friday.
- // Hello, Bill! you born a Friday.
Add Comment
Please, Sign In to add comment