Get Salesforce ID from mixed combination

Code Snippet :

String s = '01:a3E340000005BqbEAE,02:a3E340000005BqcEAE,03:a3E340000005BqdEAE';
Set<Id> setAnsId = new Set<id>();
for(String ss : s.split(',')){
    setAnsId.add(Id.valueOf(ss.subString(ss.indexOf(':')+1,ss.length())));
}
system.debug(setAnsId);

Solution :

{a3E340000005BqbEAE, a3E340000005BqcEAE, a3E340000005BqdEAE}

Featured

What is Cryptography in salesforce and what are all the algorithms provided by them ?

A). It is a security protocal between two systems. Lets say we are integration two systems without any encrytion mechanism then hackers wil...

Popular