Remove

MathBlock.Remove method

从集合中删除特定对象的第一个匹配项。

public bool Remove(IMathElement item)
范围类型描述
itemIMathElement要从集合中删除的对象。

返回值

如果item从集合中成功删除,则为真;否则为假。如果在原始集合中找不到item,此方法也会返回 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")));
mathBlock.Remove(plusElement);

也可以看看