IndexOf

MathBlock.IndexOf method

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

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

Valor_devuelto

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

Ejemplos

Ejemplo:

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

Ver también