Skip to content

Instantly share code, notes, and snippets.

@sfmishra
Created September 10, 2019 12:54
Show Gist options
  • Save sfmishra/5d4174ebb0616f0d802d7290ad6f2dea to your computer and use it in GitHub Desktop.
Save sfmishra/5d4174ebb0616f0d802d7290ad6f2dea to your computer and use it in GitHub Desktop.
Set<Id> accId = new Set<Id>();
for(Account acc : [SELECT Id, Name FROM Account LIMIT 100]) {
accId.add(acc.Id);
}
List<Id> strList = new List<Id>(accId);
system.debug('strList: ' + strList);
String str = string.join(strList, ',');
system.debug('String value : ' + str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment