String corollary to ug_findNumberInList()
String corollary to ug_findNumberInList()
(OP)
The ug_findNumberInList() works great for lists of numbers but I am struggling to find a similar way to search a list of string values for the position of a particular value in the list.
If I have a list expression as follows.
{"A","C","B"}
And I want to know the position of "B" in that list, how can I accomplish this task? I would want it to return a value of 2 after starting with zero for the first position.
[NX8.5.3.3]
If I have a list expression as follows.
{"A","C","B"}
And I want to know the position of "B" in that list, how can I accomplish this task? I would want it to return a value of 2 after starting with zero for the first position.
[NX8.5.3.3]





RE: String corollary to ug_findNumberInList()
So for your situation, it would go something like:
My_List = {"A","C","B"}
Number = Position("B",My_List) = 3
Please note that this will return a '3' and not a '2' as would the 'ug_findNumberInList()', if it would have worked with Strings.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: String corollary to ug_findNumberInList()