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

How to add character PIPE , | in string Apex

Hi All, 

I wanted to add Pipe in a string to send it make a webservice call . but Apex changes | to |

is there a way for me keep | as it is instead of changing the character.

Example :

String pipeString = 'Salesforce|Salesforce';
system.debug returns  :

is there anyway i get aound this?

Maybe you can decode it before you use it?

// Niklas