11-24-2010 04:33 AM
Any help appreciated...
I have an array of strings.
Is there a TestStand (v4.1) function that will search the array for a given string and return the element number of the array location that holds the string - if it exists in the array?
If not I'll stick to a for loop.
Thanks
Alan
11-24-2010 04:57 AM
Hi,
There isn't a function that will search your array in one hit. You will have to index through each element of the array.
Check out the inbuilt functions in the expression browser, you will find the Find function
Find(string, stringToSearchFor, <indexToSearchFrom>, <ignoreCase>, <searchInReverse>)
You will have to change the string parameter for your property or variable holding your string value.
eg
Find(Locals.MyStrArray[Locals.Index], "MySearchStr")
11-24-2010 05:01 AM
Thanks for your prompt reply
11-29-2010 03:41 PM
It might be faster to create a simple action that will input your string and a regular expression to look for a pattern in your string.