Insert()

IMathElementCollection::Insert(int32_t, System::SharedPtr<IMathElement>) method

Inserts a math element into the collection at the specified index.

virtual void Aspose::Slides::MathText::IMathElementCollection::Insert(int32_t index, System::SharedPtr<IMathElement> item)=0

Arguments

ParameterTypeDescription
indexint32_tThe zero-based index at which IMathElement should be inserted.
itemSystem::SharedPtr<IMathElement>The IMathElement to insert.

Remarks

Example:

auto collection = System::MakeObject<MathBlock>(System::MakeObject<MathematicalText>(u"x"));
auto plusElement = System::MakeObject<MathematicalText>(u"+");
collection->Add(plusElement);
collection->Insert(0, System::MakeObject<MathRadical>(System::MakeObject<MathematicalText>(u"x"), System::MakeObject<MathematicalText>(u"3")));

See Also