C# StackOverflowException when use getter -


i have getter wich change first letter of string capital. stackoverflowexception.

namespace consoleapplication1 {     class program     {         class human         {                  public string name             {                                 {                      char[] letters = name.tochararray();                     // upper case first char                     letters[0] = char.toupper(letters[0]);                     // return array made of new char array                     return new string(letters);                     //return name.first().tostring().toupper() + string.join("", name.skip(1));                 }                 set                 {                  }             } 

what wrong?

this line char[] letters = name.tochararray(); calls recursively property public string name


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

What is the difference between data design and data model(ERD) -

ios - Can NSManagedObject conform to NSCoding -