Insert

MathBlock.Insert method

将 MathElement 插入到集合中指定索引处。

public void Insert(int index, IMathElement item)
范围类型描述
indexInt32应插入 MathElement 的从零开始的索引。
itemIMathElement要插入的 MathElement。

例子

示例:

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

也可以看看