Guest User

Untitled

a guest
Dec 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. string name = "Bill";
  2. var birthday = new DateTime(1955, 10, 28);
  3.  
  4. // Formatted string C# 5:
  5. Console.WriteLine("Hello, {0}! you born a {1}.", name, birthday.DayOfWeek);
  6.  
  7. // String interpolated C# 6:
  8. Console.WriteLine($"Hello, {name}! you born a {birthday.DayOfWeek}.");
  9.  
  10. // Result:
  11. // Hello, Bill! you born a Friday.
  12. // Hello, Bill! you born a Friday.
Add Comment
Please, Sign In to add comment