0

This code is storing the stage name in string format but one of the value contain & and because of it it showing &amp by replacing the string value

string stages = ''; //string type stages variable
for (string s :stagenames ){ //loop
    stages = +stages+s+':'; //assigning value to  the stages
    System.debug(stages.unescapeHTML4()); //getting all  the values  inside it one by one
}//but one string is jack & Jill so instead of showing actual string it just showed me 'jack &amp'
Caconde
  • 4,177
  • 7
  • 35
  • 32
  • Hey Pranav. I tried this: `List stagenames = new List(); stagenames.add('jack'); stagenames.add(' '); stagenames.add('&'); stagenames.add(' '); stagenames.add('Jill'); string stages = ''; //string type stages variable for (string s :stagenames ){ //loop stages = +stages+s+':'; //assigning value to the stages System.debug(stages.unescapeHTML4()); //getting all the values inside it one by one }//but one string is jack & Jill so instead of showing actual string it just showed me 'jack &amp'` It is working fine – वरुण Apr 21 '20 at 14:06
  • Out put of my last debug log was `jack: :&: :Jill:` – वरुण Apr 21 '20 at 14:09

0 Answers0