IndexOf

MathBlock.IndexOf method

Determines the index of a specific math element in collection.

public int IndexOf(IMathElement item)
ParameterTypeDescription
itemIMathElementThe element to locate in the collection.

Return Value

The index of item if found in the collection; otherwise, -1.

Examples

Example:

[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")));
int index = mathBlock.IndexOf(plusElement);

See Also