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
Syntaxpublic int IndexOf(
Node child
)
Public Function IndexOf (
child As Node
) As Integer
public:
int IndexOf(
Node^ child
)
member IndexOf :
child : Node -> int
Parameters
- child
- Type: Aspose.WordsNode
Return Value
Type:
Int32
Remarks
Returns -1 if the node is not found in the child nodes.
ExamplesShows how to get the index of a given child node from its parent.
Document doc = new Document(MyDir + "Rendering.docx");
Body body = doc.FirstSection.Body;
int index = body.ChildNodes.IndexOf(body.LastParagraph);
See Also