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
i want to convert the set <string> to list<string>
how can do i this
Thanks in advance
You can use addAll() method of List collection to create list from set.
Example:Set<String> s=new Set<String>();s.add('xxx');s.add('yyy');List<String> l=new List<String>();l.addAll(s);
You can also use the list constructor if you want to create and initialize the list at the same time.
Set<String> setStrings = new Set<String>{'hello','world'}; List<String> listStrings = new List<String>(setStrings);
You can use addAll() method of List collection to create list from set.
Example:
Set<String> s=new Set<String>();
s.add('xxx');
s.add('yyy');
List<String> l=new List<String>();
l.addAll(s);
You can also use the list constructor if you want to create and initialize the list at the same time.