How to filter the list items

I have list of string it contains some list of names.I need check the name I am looking for is there in the list or not .I can loop through the values and check but I don’t want to loop it ,any simple code to check name I am looking for is available in the list or not.

Hi @Gayathri_Mk

You don’t need to loop to search for items.
you can directly use contains function

for eg: ListStr= {“one”,“two”,“three”}

if you use ListStr.contains(“one”), it will return true.
if you use ListStr.contains(“four”), it will return false.

Thanks

Happy Automation!

Thank you @adiijaiin

You’re welcome,

Please mark the post as solution if that worked.

Happy Automation!
:slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.