【发布时间】:2015-06-11 06:09:57
【问题描述】:
我有一个 int 类型的字典,myclass。 在 myclass 中,我具有以下属性:字符串、int 和字符串数组。
当我将数据保存在字典中时,一切正常。 但是我现在想在字典中查找,如果在 myclass 中的位置字符串数组中有一个值。并过滤它们。例如,数组“German”中包含的每个对象都应该被过滤掉。 有没有可能这样做?
我的班级:
public class MYCLASS
{
public int ID
{
get;
set;
}
public string Specialty
{
get;
set;
}
public string[] Language
{
get;
set;
}
public myclass(int id, string specialty, string[] language)
{
this.Language= language;
this.ID= id;
this.Specialty = specialty;
}
}
我的字典
Dictionary<int, myclass> objdict= new Dictionary<int, myclass>();
【问题讨论】:
-
我不明白...为什么每个请求帮助的人都无法在这里提出一个好的问题。那么您的代码在哪里,您尝试了什么,请澄清您的问题并尝试重新表述您的问题。我的天……
-
我现在看到有些文字被剪掉了。我很抱歉..
-
发布代码会很好,因为根据您的解释很难理解。
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
标签: c# object dictionary filter