function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rzsrzs 

List versus Set

Hello,

 

Is there a way to check if a given element exists in a List or not without having to iterate through every List element, or do i have to convert the List to a set and then use the contains() method ?

 

Please help

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
imuinoimuino

Theres is not a method to do this on a List you can check it in here

http://www.salesforce.com/us/developer/docs/apexcode/index.htm

All Answers

imuinoimuino

Theres is not a method to do this on a List you can check it in here

http://www.salesforce.com/us/developer/docs/apexcode/index.htm

This was selected as the best answer
rzsrzs

Thanks imuino :)