Contains

MathBlock.Contains 方法

确定集合是否包含特定值。

public bool Contains(IMathElement item)
参数类型描述
itemIMathElement要在集合中定位的对象。

返回值

如果在集合中找到 item,则为 true;否则为 false。

示例

示例:

[C#]
MathBlock mathBlock = new MathBlock(new MathematicalText("x"));
MathematicalText plusElement = new MathematicalText("+");
mathBlock.Add(plusElement);
mathBlock.Add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
bool contains = mathBlock.Contains(plusElement);

参见