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
List<String> tempList = new List<String>(); Set<String> tempSet = new Set<String>(); tempList.add('One'); tempList.add('Two'); tempList.add('Three'); tempSet.addAll(tempList);
The simplest way to convert List to Set in Salesforce is given below:
tempList is List datatype and tempSet is Set datatype.
Add some values to List datatype and use addAll() to add it to Set datatype.
Hope this helps you!
Best Regards,
Deepthi
All Answers
The simplest way to convert List to Set in Salesforce is given below:
tempList is List datatype and tempSet is Set datatype.
Add some values to List datatype and use addAll() to add it to Set datatype.
Hope this helps you!
Best Regards,
Deepthi
Please see below code for your referene.
List<String> lstString = new List<String>();
Set<String> setString = new Set<String>();
for(Integer i=0; i < 10; i++)
{
lstString.add('Test'+i);
}
setString.addAll(lstString); //It will not allow duplicate values
Thanks,
Prem Anandh