我有以下代码
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”。这怎么可能?