function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Set<String> myString = new Set<String>{'a', 'b'}; Set<String> sString = new Set<String>{'c'}; Set<String> rString = new Set<String>{'a', 'b', 'c'}; Boolean result1, result2; result1 = myString.addAll(sString); system.assertEquals(true, result1); result2 = myString.containsAll(rString); System.assertEquals(true, result2);
Set<Id> setAIds = new set<Id>{'0039000001pJpRH', '0069000000K8YjG'}; Set<Id> setBIds = new set<Id>{'0039000001pJpRH'}; system.debug('====setAIds==='+setAIds); system.debug('====setBIds==='+setBIds); for(Id objId: setAIds){ if(setBIds.contains(objId)) setBIds.remove(objId); } system.debug('====setAIds==='+setAIds); system.debug('====setBIds==='+setBIds);
ou can use "containsAll" ..
Returns true if the set contains all of the elements in the specified set. The specified set must be of the same type as the original set that calls the method. https://salesforce.stackexchange.com/questions/108091/how-to-compare-two-sets-namely-set-a-and-set-b-while-both-contains-set-of-ids-th
You can try this way
Thank You
Akshay