salesforce - How to convert SET to array in APEX? -
i have map key , value , goal list of 'key'. thinking array or list. got point have key values in set haven't figure out how convert array.
below code:
map<string, string> mmm = new map<string, string>(); mmm.put('one', 'oneee'); mmm.put('two', 'twooo'); mmm.put('three', 'threeee'); mmm.put('four', 'fourff'); //outputs values in map system.debug('=======values()==========>' + mmm.values()); //outputs key in map system.debug('=======keyset()===========>' + mmm.keyset()); //get keys in type set set<string> s = mmm.keyset(); //returns 4 system.debug('------------------------------------' + s.size()); s.arrayto() //this method not exist :(
use list.addall
method?
if not - manually loop through set...
Comments
Post a Comment