diff options
author | ksami <ksami.ihide@gmail.com> | 2017-10-23 17:50:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 17:50:07 +0800 |
commit | 467f143b9cc3c267d87b295e1ca84ef9308873a2 (patch) | |
tree | 30df97624ba8e014a133addea8b6b817884d1754 /csharp.html.markdown | |
parent | 3e072363d9b454973f116e39d4690ed73662f452 (diff) |
add example for verbatim interpolated string
Diffstat (limited to 'csharp.html.markdown')
-rw-r--r-- | csharp.html.markdown | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown index 77737182..c98a7da9 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -955,6 +955,7 @@ on a new line! ""Wow!"", the masses cried"; // String interpolation by prefixing the string with $ // and wrapping the expression you want to interpolate with { braces } + // You can also combine both interpolated and verbatim strings with $@ public class Rectangle { public int Length { get; set; } @@ -967,6 +968,9 @@ on a new line! ""Wow!"", the masses cried"; { Rectangle rect = new Rectangle { Length = 5, Width = 3 }; Console.WriteLine($"The length is {rect.Length} and the width is {rect.Width}"); + + string username = "User"; + Console.WriteLine($@"C:\Users\{username}\Desktop"); } } |