You need to sign in to do that
Don't have an account?
hamshu
concatenate value in a set
HI,
Any One Came accross like this
trigger DuplicateLead on lead (before insert,before update)
{
Set<string> lastname= new Set<string>();
for(lead lead : Trigger.new)
{
string getjoin=lead .firstname+' '+lead .lastname;
system.debug(getjoin);output=Sam Kumar
lastname.add(getjoin );
system.debug(getjoin);OutPUT:{Sam Kumar} Why ? And How to remove this
}
}
Thanks,
Jaba
Hey it is the general structure of Set. As you are adding in set that is why it showing in this format.
You can use this code out side the loop to replace
String str=String.valueOf(lastName);
str.replace('{','');
str.replace('}','');
I think it will help you .
Hi situ,
Thanks for your replay
Still i am not able to remove { and } after using Replace function too.
Thanks,
jaba
hey try this it will work
String str=String.valueOf(lastName);
String sttr=str.substring(1,str.length()-1);