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?

  • Anuj

    Member
    October 27, 2020 at 3:32 pm

    How to find if a particular value is in the list in Apex?

  • 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 .

Viewing 1 - 3 of 3 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos