function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sf sharathsf sharath 

please help me.here error coming as unexpected token solve yhe error please

set<string> colors = new set<string>{'Black'};

colors.add('Pink');
colors.add('Yellow');
colors.add('Yellow');
system.debug('color size :'+colors.size());
colors.remove('Pink');
system.debug('color size after clear :'+colors.size());

set<account> s = new set<account>();
for(account b : acc)
{
s.add(b);
}
system.debug('set size after clear :'+s.size());

Navatar_DbSupNavatar_DbSup

Hi,


I don’t think there is any issue in this code. May be you are getting the error of something else which you don’t mention in this code.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

bob_buzzardbob_buzzard

Please don't duplicate posts to this discussion board - your next post is basically asking the same question.

Teach_me_howTeach_me_how

set<string> colors = new set<string>{'Black'};

colors.add('Pink');
colors.add('Yellow');
colors.add('Yellow');
system.debug('color size :'+colors.size());
colors.remove('Pink');
system.debug('color size after clear :'+colors.size());

set<account> s = new set<account>();
for(account b : s)
{
s.add(b);
}
system.debug('set size after clear :'+s.size());