次のコードがあります
public const string boy = "B";
public const string girl = "G";
private gender(string description, string value)
{
Description = description;
Value = value;
}
public static IEnumerable<gender> GetAll()
{
yield return new gender("Boy", boy);
yield return new gender("Girl", girl);
}
プログラムに文字列「Boy」を与え、結果として文字列「B」を取得する方法を見つけたいと考えています。これはどのように可能ですか?