list class : LastIndexOfByRef(class) method
Description
It returns an index of the last child that matches as a reference.
Syntax
listInstance.LastIndexOfByRef(class search)
Arguments
Class | Name | Description |
class | search | Instance to search. |
Return value
Class | Description |
int | Index. |
Sample code
1: | list{string} stringList = new list{string}(); |
2: | string searchString = "a"; |
3: | stringList.Add(searchString); |
4: | stringList.Add("b"); |
5: | stringList.Add(searchString); |
6: | int index = stringList.LastIndexOfByRef(searchString); // The result (index) is 2. |
Notes
Starts the searching from the end of the list.
Returns 0 or more if the argument exists in the list, otherwise returns -1.
This method compare equivalence as references. Please note that do not compare equivalence as value.
Links for reference
None