Activity Forums Salesforce® Discussions How to find if a particular value is in the list in Apex?

  • 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 4 years 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);

  • Ayush

    Member
    October 28, 2020 at 5:47 am

    With the help of contains method .

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos