title: Add a Count property to custom class in C#
body: <p>So I have a custom class (ie, MyClass), which I then use to declare an array.  How would I add a '.Count' property to my custom class to get the size of the array?</p>
  
  <p>Thank you.</p>
  
  <pre><code>static void Main()
  {
      MyClass[] test = new MyClass[2];
      test[0].str = "Hello";
      test[1].str = "World";
  
      Console.WriteLine("Count : " + test.Count);
  }
  
  
  class MyClass
  {
      public string str;
  }
  </code></pre>