search for an occurrence of an element in a list
search for all occurrences of an element in a list
Search( element, L )
SearchAll( element, L )
The Search(element, L) calling sequence searches for element in the list L. If element does not occur as an element of L, then 0 is returned. Otherwise, the index of the first occurrence of element in L is returned.
Note: The list L is not assumed to be sorted, so the time taken by this procedure may be linear in the length of the list.
The SearchAll(element, L) calling sequence finds all occurrences of element in L. It returns an expression sequence of the indices of occurrences of element in L. This expression sequence is NULL if element does not occur in L.
In order to search for elements satisfying a certain predicate, use SelectFirst.
Download Help Document