I want to search if a string is in a datapage. Both of these functions appear to do the same thing so I was wondering if one was better than the other.
By using IsInPagelist function, we will be able to find whether the exact match string is available inside pagelist (or) not.
PageListContains function also capable of doing the same comparison, additional to exact match you can look for starts with comparison rather than exact equal match by making aMatchStart parameter as true.
Hi @OkiO16887019: Please refer to the reply from @Gunasekaran Baskaran regarding the feature difference. In terms of preference, there is no specified preference. You need to choose one based on the use case.
In terms of the code, one use the for loop and the other use Iterator. No concerns with both.
Please also note on the additional feature in PageListContains where it can do a starts with check (case insensitive).
In my view, IsInPageList is widely used. So if your use case is just to check whether a specific value is available in a specific property of a page list (case sensitive search), then i would suggest to use IsInPageList.
Thanks.
IsInPageList does string matching so its it a faster process. It’ll only set as true if the whole string is found. Eg: if ‘abc’ is being checked upon then it’ll return true only if ‘abc’ is found.
PageListContains does partial search so its a slower process. It’ll search the whole list and return true even if there’s a partial match. Eg: if ‘abc’ is being checked upon then it’ll return true on ‘ab’ or ‘bc’ or ‘abc’ etc.