0

I am trying to generate CSV file with the pipe | as delimiter but the issue that I am facing is it is converting separator into |

For example, if csv headers are contained in the list shown below and later if I try to join it using pipe | using it outputs unexpected data.

List<String> listData = new List<String>{ 'Name' ,'ID', 'Stage'};
string.join(listData,'|');

output Name&#124;ID&#124;Stage instead of Name|ID|Stage

I tried to search so many threads but did not find any solution hence had to post it again

  • 3
    No, Apex doesn't do that (try this in an execute anonymous script, you'll see it comes out right). How are you attempting to render this string? – sfdcfox May 29 at 7:25
  • Double-check the concoding of the file, just in case – Sergio Alcocer May 29 at 8:14
  • I guess it is the editor that shows the Pipe symbol as HTML encoded value &#124; – Hunt May 29 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.