diff options
Diffstat (limited to 'csharp.html.markdown')
| -rw-r--r-- | csharp.html.markdown | 21 | 
1 files changed, 20 insertions, 1 deletions
| diff --git a/csharp.html.markdown b/csharp.html.markdown index 8d185462..4c9e8411 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -8,6 +8,7 @@ contributors:      - ["Wouter Van Schandevijl", "http://github.com/laoujin"]      - ["Jo Pearce", "http://github.com/jdpearce"]      - ["Chris Zimmerman", "https://github.com/chriszimmerman"] +    - ["Shawn McGuire", "https://github.com/bigbash"]  filename: LearnCSharp.cs  --- @@ -825,7 +826,7 @@ on a new line! ""Wow!"", the masses cried";          }          // Methods can also be static. It can be useful for helper methods -        public static bool DidWeCreateEnoughBycles() +        public static bool DidWeCreateEnoughBicycles()          {              // Within a static method, we only can reference static class members              return BicyclesCreated > 9000; @@ -947,6 +948,24 @@ on a new line! ""Wow!"", the masses cried";              A.A2();          }      } +     +    // String interpolation by prefixing the string with $ +    // and wrapping the expression you want to interpolate with { braces } +    public class Rectangle +    { +        public int Length { get; set; } +        public int Width { get; set; } +    } +     +    class Program +    { +        static void Main(string[] args) +        { +            Rectangle rect = new Rectangle { Length = 5, Width = 3 }; +            Console.WriteLine($"The length is {rect.Length} and the width is {rect.Width}"); +        } +    } +      } // End Namespace  ``` | 
