Activity Forums Salesforce® Discussions 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 .

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos