IndexOf()

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

Determines the index of a specific math element in collection.

virtual int32_t Aspose::Slides::MathText::IMathElementCollection::IndexOf(System::SharedPtr<IMathElement> item)=0

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 collection = System::MakeObject<MathBlock>(System::MakeObject<MathematicalText>(u"x"));
auto plusElement = System::MakeObject<MathematicalText>(u"+");
collection->Add(plusElement);
collection->Add(System::MakeObject<MathRadical>(System::MakeObject<MathematicalText>(u"x"), System::MakeObject<MathematicalText>(u"3")));
int32_t index = collection->IndexOf(plusElement);

See Also