Contains
IMathElementCollection.Contains 方法
确定集合中是否包含特定值。
public bool Contains(IMathElement item)
参数 | 类型 | 描述 |
---|---|---|
item | IMathElement | 要在集合中定位的对象。 |
返回值
如果在集合中找到 item,则为 true;否则为 false。
示例
示例:
[C#]
IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
MathematicalText plusElement = new MathematicalText("+");
collection.Add(plusElement);
collection.Add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
bool contains = collection.Contains(plusElement);