Activity › Forums › Salesforce® Discussions › How to find if a particular value is in the list in Apex? Salesforce® Discussions How to find if a particular value is in the list in Apex? Posted by Anuj on October 27, 2020 at 3:32 PM How to find if a particular value is in the list in Apex? Ayush replied 5 years, 7 months ago 3 Members · 2 Replies 2 Replies Kirandeep Member October 27, 2020 at 3:33 PM set<string> myString = new Set<String>{‘a’, ‘b’}; Boolean result; result = myString.contains(‘z’); system.assertEquals(result, false); [adinserter block='9'] Ayush Member October 28, 2020 at 5:47 AM With the help of contains method . Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me