我已经把第一个字母串改为首都了.但我得到StackOverflowException.
namespace ConsoleApplication1
{
class Program
{
class Human
{
public String Name
{
get
{
char[] letters = Name.ToCharArray();
// upper case the first char
letters[0] = char.ToUpper(letters[0]);
// return the array made of the new char array
return new String(letters);
//return Name.First().ToString().ToUpper() + String.Join("", Name.Skip(1));
}
set
{
}
}
Run Code Online (Sandbox Code Playgroud)
我做错了什么?