CompositeNodeIndexOf Method

Returns the index of the specified child node in the child node array.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public int IndexOf(
	Node child
)

Parameters

child
Type: Aspose.WordsNode

Return Value

Type: Int32
Remarks
Returns -1 if the node is not found in the child nodes.
Examples
Shows how to get the index of a given child node from its parent.
Document doc = new Document(MyDir + "Rendering.docx");

// Get the body of the first section in the document
Body body = doc.FirstSection.Body;
// Retrieve the index of the last paragraph in the body
int index = body.ChildNodes.IndexOf(body.LastParagraph);
See Also