IndexOf

IMathElementCollection.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#]
IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
MathematicalText plusElement = new MathematicalText("+");
collection.Add(plusElement);
collection.Add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
int index = collection.IndexOf(plusElement);

See Also