IndexOf

IMathElementCollection.IndexOf method

Determina el índice de un elemento matemático específico en la colección.

public int IndexOf(IMathElement item)
ParámetroTipoDescripción
itemIMathElementEl elemento a localizar en la colección.

Valor de retorno

El índice de item si se encuentra en la colección; de lo contrario, -1.

Ejemplos

Ejemplo:

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

Véase también