Contains

MathBlock.Contains method

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

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

返回值

如果在集合中找到item则为真;否则为假。

例子

示例:

[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);

也可以看看