You need to sign in to do that
Don't have an account?
shra1_dev
How to take emailIds in an Object to a List<String>
Hi,
I hav an object in that I have emailId field. I want to take all the emailId's in that object to a List<String>.
how to do this?
please help me.........
Regards,
shra1
List<string> emailIds=new List<String>();
Contact[] cnts=[Select email from contact where email!=null limit 10];
for(Contact c:cnts){
if(c.email!=null){
emailIds.add(string.valueof(c.email));
}
}
system.debug(emailIds);