Quantcast
Channel: Cadence Custom IC Skill Forum
Viewing all articles
Browse latest Browse all 5094

Is there a command to return the index of an element if it exists in a list or array?

$
0
0

Hopefully a quickie (and I did search the documentation beforehand). I'm looking for a command that will take an array (preferred) or list and an object return the index of the object if it exists in the array or list. I know I can use e.g. the member function and do a subtraction between the lengths of the original and member lists, but I was hoping there was a native command that just did what I was after. Ideally the command would look like:

myList = list(1 2 "ab" "ef" 1.234)  

some_function("ef" myList)  would return 3  (i.e. nth(3 myList) yields "ef")


Viewing all articles
Browse latest Browse all 5094

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>