list class : FindAll(class) method

Description

It stores the all children that matches as a value in the list and returns it.

Syntax

listInstance.FindAll(class searchInstance)

Arguments

ClassNameDescription
classsearchInstanceAn instance to search as value.

Return value

ClassDescription
listA list with all child elements that match as a value.

Sample code

1:

list{string} stringList = new list{string}();

2:

stringList.Add("a");

3:

stringList.Add("b");

4:

stringList.Add("a");

5:

list resultList = stringList.FindAll("a"); // The result (resultList) has the first and last child of the list.

Notes

This method returns all children itself that match as value.

If there is no element that matches as a value, an empty list is returned.

The argument must be the int, long, real, string, or bool. It is meaningless in other types.

Links for reference

None

Copyright © Rice All rights reserved.