IndexOf()

MathBlock::IndexOf(System::SharedPtr<IMathElement>) method

Determines the index of a specific math element in collection.

int32_t Aspose::Slides::MathText::MathBlock::IndexOf(System::SharedPtr<IMathElement> item) override

Arguments

ParameterTypeDescription
itemSystem::SharedPtr<IMathElement>The element to locate in the collection.

Return Value

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

Remarks

Example:

auto mathBlock = System::MakeObject<MathBlock>(System::MakeObject<MathematicalText>(u"x"));
auto plusElement = System::MakeObject<MathematicalText>(u"+");
mathBlock->Add(plusElement);
mathBlock->Add(System::MakeObject<MathRadical>(System::MakeObject<MathematicalText>(u"x"), System::MakeObject<MathematicalText>(u"3")));
int32_t index = mathBlock->IndexOf(plusElement);

See Also